tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
Protected Member Functions | Properties | List of all members
Tgstation.Server.Client.ApiException Class Referenceabstract

API related Exceptions. More...

Inheritance diagram for Tgstation.Server.Client.ApiException:
Inheritance graph
[legend]
Collaboration diagram for Tgstation.Server.Client.ApiException:
Collaboration graph
[legend]

Protected Member Functions

 ApiException (ErrorMessageResponse? errorMessage, HttpResponseMessage responseMessage)
 Initializes a new instance of the ApiException class.
 
 ApiException (HttpResponseMessage responseMessage, string message)
 Initializes a new instance of the ApiException class.
 
 ApiException ()
 Initializes a new instance of the ApiException class.
 
 ApiException (string message)
 Initializes a new instance of the ApiException class.
 
 ApiException (string message, Exception innerException)
 Initializes a new instance of the ApiException class.
 
- Protected Member Functions inherited from Tgstation.Server.Client.ClientException
 ClientException (HttpResponseMessage responseMessage, string message)
 Initializes a new instance of the ClientException class.
 
 ClientException ()
 Initializes a new instance of the ClientException class.
 
 ClientException (string message)
 Initializes a new instance of the ClientException class.
 
 ClientException (string message, Exception innerException)
 Initializes a new instance of the ClientException class.
 

Properties

Version? ServerApiVersion [get]
 The Version of the server's API.
 
string? AdditionalServerData [get]
 Additional error data from the server.
 
ErrorCodeErrorCode [get]
 The API ErrorCode if applicable.
 
- Properties inherited from Tgstation.Server.Client.ClientException
HttpResponseMessage? ResponseMessage [get]
 The HttpStatusCode of the ClientException.
 

Detailed Description

API related Exceptions.

Definition at line 12 of file ApiException.cs.

Constructor & Destructor Documentation

◆ ApiException() [1/5]

Tgstation.Server.Client.ApiException.ApiException ( ErrorMessageResponse errorMessage,
HttpResponseMessage  responseMessage 
)
protected

Initializes a new instance of the ApiException class.

Parameters
errorMessageThe ErrorMessageResponse returned from the API.
responseMessageThe HttpResponseMessage.

Definition at line 34 of file ApiException.cs.

35 : base(
36 responseMessage,
37 errorMessage?.Message ?? $"HTTP {responseMessage?.StatusCode ?? throw new ArgumentNullException(nameof(responseMessage))}. Unknown API error, ErrorMessage payload not present!")
38 {
39 ServerApiVersion = errorMessage?.ServerApiVersion;
40 AdditionalServerData = errorMessage?.AdditionalData;
41 ErrorCode = errorMessage?.ErrorCode;
42 }
string? AdditionalServerData
Additional error data from the server.
Version? ServerApiVersion
The Version of the server's API.
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.
Definition ErrorCode.cs:12

References Tgstation.Server.Api.Models.Response.ErrorMessageResponse.AdditionalData, Tgstation.Server.Client.ApiException.AdditionalServerData, Tgstation.Server.Api.Models.Response.ErrorMessageResponse.ErrorCode, Tgstation.Server.Api.Models.Response.ErrorMessageResponse.ServerApiVersion, and Tgstation.Server.Client.ApiException.ServerApiVersion.

◆ ApiException() [2/5]

Tgstation.Server.Client.ApiException.ApiException ( HttpResponseMessage  responseMessage,
string  message 
)
protected

Initializes a new instance of the ApiException class.

Parameters
responseMessageThe HttpResponseMessage.
messageThe Exception.Message.

Definition at line 49 of file ApiException.cs.

50 : base(responseMessage, message)
51 {
52 }

◆ ApiException() [3/5]

Tgstation.Server.Client.ApiException.ApiException ( )
protected

Initializes a new instance of the ApiException class.

Definition at line 57 of file ApiException.cs.

58 {
59 }

◆ ApiException() [4/5]

Tgstation.Server.Client.ApiException.ApiException ( string  message)
protected

Initializes a new instance of the ApiException class.

Parameters
messageThe message for the Exception.

Definition at line 65 of file ApiException.cs.

66 : base(message)
67 {
68 }

◆ ApiException() [5/5]

Tgstation.Server.Client.ApiException.ApiException ( string  message,
Exception  innerException 
)
protected

Initializes a new instance of the ApiException class.

Parameters
messageThe message for the Exception.
innerExceptionThe inner Exception for the base Exception.

Definition at line 75 of file ApiException.cs.

76 : base(message, innerException)
77 {
78 }

Property Documentation

◆ AdditionalServerData

string? Tgstation.Server.Client.ApiException.AdditionalServerData
get

Additional error data from the server.

Definition at line 22 of file ApiException.cs.

22{ get; }

Referenced by Tgstation.Server.Client.ApiException.ApiException().

◆ ErrorCode

ErrorCode? Tgstation.Server.Client.ApiException.ErrorCode
get

The API ErrorCode if applicable.

Definition at line 27 of file ApiException.cs.

27{ get; }

◆ ServerApiVersion

Version? Tgstation.Server.Client.ApiException.ServerApiVersion
get

The Version of the server's API.

Definition at line 17 of file ApiException.cs.

17{ get; }

Referenced by Tgstation.Server.Client.ApiException.ApiException().


The documentation for this class was generated from the following file: