File tree Expand file tree Collapse file tree
src/MediaConverters/MediaConverters.Tool/Contexts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Text ;
5+ using System . Threading . Tasks ;
6+
7+ namespace DotNetCampus . MediaConverter . Contexts ;
8+
9+ internal readonly record struct ErrorCode
10+ {
11+ /// <summary>
12+ /// 成功
13+ /// </summary>
14+ public static readonly ErrorCode Success = new ( 0 , "Success" ) ;
15+
16+ /// <summary>
17+ /// 未知错误
18+ /// </summary>
19+ public static readonly ErrorCode UnknownError = new ( - 1 , "Unknown error" ) ;
20+
21+ /// <summary>
22+ /// 错误代码
23+ /// </summary>
24+ public int Code { get ; init ; }
25+
26+ /// <summary>
27+ /// 错误信息
28+ /// </summary>
29+ public string Message { get ; init ; }
30+
31+ public ErrorCode ( int code , string message )
32+ {
33+ Code = code ;
34+ Message = message ;
35+
36+ CodeList ??= [ ] ;
37+ CodeList . Add ( this ) ;
38+ }
39+
40+ private static List < ErrorCode > ? CodeList { get ; set ; }
41+ }
You can’t perform that action at this time.
0 commit comments