Errors.d.ts 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import { HttpTransportType } from "./ITransport";
  2. /** Error thrown when an HTTP request fails. */
  3. export declare class HttpError extends Error {
  4. private __proto__;
  5. /** The HTTP status code represented by this error. */
  6. statusCode: number;
  7. /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.
  8. *
  9. * @param {string} errorMessage A descriptive error message.
  10. * @param {number} statusCode The HTTP status code represented by this error.
  11. */
  12. constructor(errorMessage: string, statusCode: number);
  13. }
  14. /** Error thrown when a timeout elapses. */
  15. export declare class TimeoutError extends Error {
  16. private __proto__;
  17. /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.
  18. *
  19. * @param {string} errorMessage A descriptive error message.
  20. */
  21. constructor(errorMessage?: string);
  22. }
  23. /** Error thrown when an action is aborted. */
  24. export declare class AbortError extends Error {
  25. private __proto__;
  26. /** Constructs a new instance of {@link AbortError}.
  27. *
  28. * @param {string} errorMessage A descriptive error message.
  29. */
  30. constructor(errorMessage?: string);
  31. }
  32. /** Error thrown when the selected transport is unsupported by the browser. */
  33. /** @private */
  34. export declare class UnsupportedTransportError extends Error {
  35. private __proto__;
  36. /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */
  37. transport: HttpTransportType;
  38. /** The type name of this error. */
  39. errorType: string;
  40. /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.
  41. *
  42. * @param {string} message A descriptive error message.
  43. * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.
  44. */
  45. constructor(message: string, transport: HttpTransportType);
  46. }
  47. /** Error thrown when the selected transport is disabled by the browser. */
  48. /** @private */
  49. export declare class DisabledTransportError extends Error {
  50. private __proto__;
  51. /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */
  52. transport: HttpTransportType;
  53. /** The type name of this error. */
  54. errorType: string;
  55. /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.
  56. *
  57. * @param {string} message A descriptive error message.
  58. * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.
  59. */
  60. constructor(message: string, transport: HttpTransportType);
  61. }
  62. /** Error thrown when the selected transport cannot be started. */
  63. /** @private */
  64. export declare class FailedToStartTransportError extends Error {
  65. private __proto__;
  66. /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */
  67. transport: HttpTransportType;
  68. /** The type name of this error. */
  69. errorType: string;
  70. /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.
  71. *
  72. * @param {string} message A descriptive error message.
  73. * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.
  74. */
  75. constructor(message: string, transport: HttpTransportType);
  76. }
  77. /** Error thrown when the negotiation with the server failed to complete. */
  78. /** @private */
  79. export declare class FailedToNegotiateWithServerError extends Error {
  80. private __proto__;
  81. /** The type name of this error. */
  82. errorType: string;
  83. /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.
  84. *
  85. * @param {string} message A descriptive error message.
  86. */
  87. constructor(message: string);
  88. }
  89. /** Error thrown when multiple errors have occurred. */
  90. /** @private */
  91. export declare class AggregateErrors extends Error {
  92. private __proto__;
  93. /** The collection of errors this error is aggregating. */
  94. innerErrors: Error[];
  95. /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.
  96. *
  97. * @param {string} message A descriptive error message.
  98. * @param {Error[]} innerErrors The collection of errors this error is aggregating.
  99. */
  100. constructor(message: string, innerErrors: Error[]);
  101. }