tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
ErrorMessageException.cs
Go to the documentation of this file.
1using System;
2
5
6#pragma warning disable CA1032 // Shitty unneeded additional Exception constructors
7
9{
13 public sealed class ErrorMessageException : Exception
14 {
18 public ErrorCode? ErrorCode { get; }
19
23 public string? AdditionalData { get; }
24
30 public ErrorMessageException(ErrorMessageResponse errorMessage, string fallbackMessage)
31 : base((errorMessage ?? throw new ArgumentNullException(nameof(errorMessage))).Message ?? fallbackMessage)
32 {
33 ErrorCode = errorMessage.ErrorCode != default ? errorMessage.ErrorCode : null;
34 AdditionalData = errorMessage.AdditionalData;
35 }
36
42 : this(new ErrorMessageResponse(errorCode), String.Empty)
43 {
44 }
45 }
46}
Represents an error message returned by the server.
string? AdditionalData
Additional data associated with the error message.
Exception representing ErrorMessageResponses.
ErrorMessageException(ErrorCode errorCode)
Initializes a new instance of the ErrorMessageException class.
string? AdditionalData
The ErrorMessageResponse.AdditionalData.
ErrorMessageException(ErrorMessageResponse errorMessage, string fallbackMessage)
Initializes a new instance of the ErrorMessageException class.
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.
Definition ErrorCode.cs:12