Exception Handling

The WellViaSDK uses Exceptions to handle errors that may arise when using the library. All libraries use the same WellViaException that is made available through the shared WellViaSDK.Core library.

WellViaAPIException

Extends the WellViaException to include additional properties that are unique to API requests. This is the most frequent type of Exception you will reference.

Properties


Notable properties of this object include:

  • Message - A human-readable message providing more details about the error.
  • ErrorCode - The unique identifier representing this type of error.
  • Language - The ISO code representing the language being used in the Message.
  • StatusCode - Specifies the HTTP Status Code included in the API response headers.
  • CorrelationId - The unique identifier assigned to the API request and response. This may be requested for debugging purposes by the Recuro Health team if you are requesting technical support.

Example


using WellViaSDK.Core;

try
{
	// Make a SDK call here
}
catch (WellViaAPIException ex)
{
	// Handle errors as you see fit
	Console.WriteLine(ex.ErrorCode + ": " + ex.Message);
}