RpcException.cs 537 B

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