RpcException.cs 581 B

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