forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResponseStatus.cs
More file actions
80 lines (72 loc) · 2.25 KB
/
ResponseStatus.cs
File metadata and controls
80 lines (72 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
// $Id: ResponseStatus.cs 11037 2010-02-03 12:36:14Z Demis Bellot $
//
// Revision : $Revision: 11037 $
// Modified Date : $LastChangedDate: 2010-02-03 12:36:14 +0000 (Wed, 03 Feb 2010) $
// Modified By : $LastChangedBy: Demis Bellot $
//
// (c) Copyright 2010 Liquidbit Ltd
*/
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace ServiceStack.ServiceInterface.ServiceModel
{
/// <summary>
/// Common ResponseStatus class that should be present on all response DTO's
/// </summary>
[DataContract]
public class ResponseStatus
{
/// <summary>
/// Initializes a new instance of the <see cref="ResponseStatus"/> class.
///
/// A response status without an errorcode == success
/// </summary>
public ResponseStatus()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ResponseStatus"/> class.
///
/// A response status with an errorcode == failure
/// </summary>
public ResponseStatus(string errorCode)
{
this.ErrorCode = errorCode;
}
/// <summary>
/// Initializes a new instance of the <see cref="ResponseStatus"/> class.
///
/// A response status with an errorcode == failure
/// </summary>
public ResponseStatus(string errorCode, string message)
: this(errorCode)
{
this.Message = message;
}
/// <summary>
/// Holds the custom ErrorCode enum if provided in ValidationException
/// otherwise will hold the name of the Exception type, e.g. typeof(Exception).Name
///
/// A value of non-null means the service encountered an error while processing the request.
/// </summary>
[DataMember]
public string ErrorCode { get; set; }
/// <summary>
/// A human friendly error message
/// </summary>
[DataMember]
public string Message { get; set; }
/// <summary>
///
/// </summary>
[DataMember]
public string StackTrace { get; set; }
/// <summary>
/// For multiple detailed validation errors.
/// Can hold a specific error message for each named field.
/// </summary>
[DataMember]
public List<ResponseError> Errors { get; set; }
}
}