Common .NET SDK Exceptions

  • Updated

Issue

An exception is being thrown while using the .NET SDK.

Causes & Resolutions

The following list details possible exceptions along with their causes and resolutions:


Exception

System.ArgumentException

Cause

This error may be thrown for a couple of reasons:

  • A required parameter for requests is missing (username, service key, api key)
  • The URL parameter has an invalid URI value

Resolution

Check to make sure all parameters have been supplied and are valid.


Exception

System.AggregateException

Cause

This error is often thrown when the request cannot resolve or reach the host name supplied.

Resolution

Check to ensure that the hostname of the Contrast UI can be resolved successfully on the client system.


Exception

contrast_rest_dotnet.ResourceNotFoundException

Cause

This error is thrown whenever HTTP status code 404 is returned by the host.

Resolution

Ensure the resource requested is valid. 


Exception

contrast_rest_dotnet.ForbiddenException

Cause

This error can be thrown due to insufficient permissions or the credentials supplied are invalid.

Resolution

Ensure that the user's credentials are valid and also the user has the required access to perform the action requested.


Exception

contrast_rest_dotnet.ContrastApiException

Cause

This exception will be thrown if the Contrast UI returns an unrecognized response to the SDK (usually in the form of a 500 Internal Server Error).

Resolution

If this exception presents itself too frequently while using the same function, please create an issue in our GitHub repository for us to take a closer look.

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request