12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace JsonRPC4.Common
- {
- // Token: 0x0200000D RID: 13
- public class RpcException : Exception
- {
- public int ErrorCode
- {
- get;
- }
- public object RpcData
- {
- get;
- }
- public RpcException(int errorCode, string message, Exception innerException = null, object data = null)
- : base(message, innerException)
- {
- ErrorCode = errorCode;
- RpcData = data;
- }
- public RpcException(RpcErrorCode errorCode, string message, Exception innerException = null, object data = null)
- : this((int)errorCode, message, innerException, data)
- {
- }
- public RpcError ToRpcError(bool includeServerErrors)
- {
- string text = Message;
- if (includeServerErrors)
- {
- text = text + Environment.NewLine + "Exception: " + base.InnerException;
- }
- return new RpcError(ErrorCode, text, RpcData);
- }
- }
- }
|