RpcRouterExceptions.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. namespace EdjCase.JsonRpc.Router
  6. {
  7. /// <summary>
  8. /// Base exception for all rpc router exceptions
  9. /// </summary>
  10. public abstract class RpcRouterException : Exception
  11. {
  12. /// <param name="message">Error message</param>
  13. protected RpcRouterException(string message, Exception ex = null) : base(message, ex)
  14. {
  15. }
  16. }
  17. /// <summary>
  18. /// Exception for bad configuration of the Rpc server
  19. /// </summary>
  20. //Not a response exception so it is not an `RpcException`
  21. public class RpcConfigurationException : RpcRouterException
  22. {
  23. /// <param name="message">Error message</param>
  24. public RpcConfigurationException(string message) : base(message)
  25. {
  26. }
  27. }
  28. /// <summary>
  29. /// Exception for a canceled rpc request
  30. /// </summary>
  31. //Not a response exception so it is not an `RpcException`
  32. public class RpcCanceledRequestException : RpcRouterException
  33. {
  34. /// <param name="message">Error message</param>
  35. public RpcCanceledRequestException(string message, Exception ex = null) : base(message, ex)
  36. {
  37. }
  38. }
  39. }