using Grpc.Extension.Abstract.Model;
using System;
using System.Collections.Generic;
using System.Text;
namespace Grpc.Extension.Abstract
{
///
/// Grpc.Extension内部异常
///
public class InternalException : Exception
{
private int Code { get; set; }
///
/// InternalException
///
///
public InternalException(int code)
{
this.SetCode(code);
}
///
/// InternalException
///
///
///
public InternalException(int code, string message) : base(message)
{
this.SetCode(code);
}
///
/// InternalException
///
///
///
///
public InternalException(int code, string message, Exception innerException) : base(message, innerException)
{
this.SetCode(code);
}
///
/// SetCode
///
///
public void SetCode(int code)
{
this.Code = GrpcErrorCode.DefaultErrorCode + code;
this.Data.Add("ErrorCode", this.Code);
}
}
}