Class ClientExceptionConverter
- Namespace
- VpnHood.Core.Client.VpnServices.Abstractions
- Assembly
- VpnHood.Core.Client.VpnServices.Abstractions.dll
Provides the conversion of an error the VPN service reported back into the exception it stands for.
public static class ClientExceptionConverter
- Inheritance
-
ClientExceptionConverter
- Inherited Members
Methods
ApiErrorToException(ApiError)
Makes the exception an error stands for, where it is one of the client's or the service's that the app handles by type, with the error's data.
public static Exception? ApiErrorToException(ApiError apiError)
Parameters
apiErrorApiErrorThe error.
Returns
Remarks
A ServerAddressChangedException made here has no NewAddresses: they stay in the service's process.
Exceptions
- ArgumentException
A session's error carries no response.
- JsonException
A session's error carries a response that is not JSON.
- FormatException
An endpoint in a session's error's response is not valid.