Table of Contents

Class ErrorMessages

Namespace
VpnHood.AppUi.Common
Assembly
VpnHood.AppUi.Common.dll

Provides the sentence for a failure, and the buttons that go with it, as the app reports it, in process or over HTTP.

public static class ErrorMessages
Inheritance
ErrorMessages
Inherited Members

Remarks

Every button is decided here, so a dialog only draws what it is given.

Methods

For(Exception, ErrorContext)

Gets what the UI does about a failure.

public static ErrorMessage For(Exception exception, ErrorContext context)

Parameters

exception Exception

The failure.

context ErrorContext

What the sentence and the buttons depend on besides the failure.

Returns

ErrorMessage

What to do.

Exceptions

InvalidOperationException

The words have not been loaded (InitAsync(IAssetProvider, CancellationToken)).

For(ApiError, ErrorContext)

Gets what the UI does about a failure, as the app reported it.

public static ErrorMessage For(ApiError error, ErrorContext context)

Parameters

error ApiError

The failure.

context ErrorContext

What the sentence and the buttons depend on besides the failure.

Returns

ErrorMessage

What to do.

Exceptions

InvalidOperationException

The words have not been loaded (InitAsync(IAssetProvider, CancellationToken)).

ForText(string, ErrorContext)

Gets a dialog for a sentence of the UI's own, shown the way a failure is.

public static ErrorMessage ForText(string text, ErrorContext context)

Parameters

text string

The sentence.

context ErrorContext

What the buttons depend on.

Returns

ErrorMessage

The dialog.