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
exceptionExceptionThe failure.
contextErrorContextWhat 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
errorApiErrorThe failure.
contextErrorContextWhat 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
textstringThe sentence.
contextErrorContextWhat the buttons depend on.
Returns
- ErrorMessage
The dialog.