forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessagingException.cs
More file actions
35 lines (27 loc) · 1.08 KB
/
MessagingException.cs
File metadata and controls
35 lines (27 loc) · 1.08 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
using System;
using ServiceStack.Model;
namespace ServiceStack.Messaging
{
public class MessagingException : Exception, IHasResponseStatus, IResponseStatusConvertible
{
public MessagingException() {}
public MessagingException(string message) : base(message) {}
public MessagingException(string message, Exception innerException) : base(message, innerException) {}
public MessagingException(ResponseStatus responseStatus, Exception innerException = null)
: base(responseStatus.Message ?? responseStatus.ErrorCode, innerException)
{
ResponseStatus = responseStatus;
}
public MessagingException(ResponseStatus responseStatus, object responseDto, Exception innerException = null)
: this(responseStatus, innerException)
{
ResponseDto = responseDto;
}
public object ResponseDto { get; set; }
public ResponseStatus ResponseStatus { get; set; }
public ResponseStatus ToResponseStatus()
{
return ResponseStatus;
}
}
}