RpcException.cs 463 B

1234567891011121314151617181920212223
  1. using System;
  2. namespace Model
  3. {
  4. /// <summary>
  5. /// RPC异常,带ErrorCode
  6. /// </summary>
  7. [Serializable]
  8. public class RpcException: Exception
  9. {
  10. public int Error { get; private set; }
  11. public RpcException(int error, string message): base($"Error: {error} Message: {message}")
  12. {
  13. this.Error = error;
  14. }
  15. public RpcException(int error, string message, Exception e): base($"Error: {error} Message: {message}", e)
  16. {
  17. this.Error = error;
  18. }
  19. }
  20. }