tgstation-server
6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
src
Tgstation.Server.Api
Models
ErrorCodeExtensions.cs
Go to the documentation of this file.
1
using
System.Collections.Generic;
2
using
System.ComponentModel;
3
using
System.Linq;
4
5
namespace
Tgstation.Server.Api.Models
6
{
10
public
static
class
ErrorCodeExtensions
11
{
17
public
static
string
?
Describe
(
this
ErrorCode
errorCode)
18
{
19
var attributes = (IEnumerable<DescriptionAttribute>?)typeof(
ErrorCode
)
20
.GetField(errorCode.ToString())
21
?.GetCustomAttributes(typeof(DescriptionAttribute),
false
);
22
23
return
attributes?.FirstOrDefault()?.Description;
24
}
25
}
26
}
Tgstation.Server.Api.Models.ErrorCodeExtensions
Extension methods for the ErrorCode enum.
Definition
ErrorCodeExtensions.cs:11
Tgstation.Server.Api.Models.ErrorCodeExtensions.Describe
static ? string Describe(this ErrorCode errorCode)
Describe a given errorCode .
Definition
ErrorCodeExtensions.cs:17
Tgstation.Server.Api.Models
Definition
ChatChannel.cs:6
Tgstation.Server.Api.Models.ErrorCode
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.
Definition
ErrorCode.cs:12
Generated by
1.9.8