@tsed/exceptions 7.0.0-alpha.2 → 7.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/lib/cjs/clientErrors/BadMapping.js +13 -0
  2. package/lib/cjs/clientErrors/BadMapping.js.map +1 -0
  3. package/lib/cjs/clientErrors/BadRequest.js +12 -0
  4. package/lib/cjs/clientErrors/BadRequest.js.map +1 -0
  5. package/lib/cjs/clientErrors/Conflict.js +12 -0
  6. package/lib/cjs/clientErrors/Conflict.js.map +1 -0
  7. package/lib/cjs/clientErrors/ExpectationFailed.js +12 -0
  8. package/lib/cjs/clientErrors/ExpectationFailed.js.map +1 -0
  9. package/lib/cjs/clientErrors/Forbidden.js +12 -0
  10. package/lib/cjs/clientErrors/Forbidden.js.map +1 -0
  11. package/lib/cjs/clientErrors/Gone.js +12 -0
  12. package/lib/cjs/clientErrors/Gone.js.map +1 -0
  13. package/lib/cjs/clientErrors/ImATeapot.js +13 -0
  14. package/lib/cjs/clientErrors/ImATeapot.js.map +1 -0
  15. package/lib/cjs/clientErrors/LengthRequired.js +12 -0
  16. package/lib/cjs/clientErrors/LengthRequired.js.map +1 -0
  17. package/lib/cjs/clientErrors/MethodNotAllowed.js +12 -0
  18. package/lib/cjs/clientErrors/MethodNotAllowed.js.map +1 -0
  19. package/lib/cjs/clientErrors/MisdirectedRequest.js +12 -0
  20. package/lib/cjs/clientErrors/MisdirectedRequest.js.map +1 -0
  21. package/lib/cjs/clientErrors/NotAcceptable.js +12 -0
  22. package/lib/cjs/clientErrors/NotAcceptable.js.map +1 -0
  23. package/lib/cjs/clientErrors/NotFound.js +12 -0
  24. package/lib/cjs/clientErrors/NotFound.js.map +1 -0
  25. package/lib/cjs/clientErrors/PaymentRequired.js +12 -0
  26. package/lib/cjs/clientErrors/PaymentRequired.js.map +1 -0
  27. package/lib/cjs/clientErrors/PreconditionFailed.js +12 -0
  28. package/lib/cjs/clientErrors/PreconditionFailed.js.map +1 -0
  29. package/lib/cjs/clientErrors/PreconditionRequired.js +12 -0
  30. package/lib/cjs/clientErrors/PreconditionRequired.js.map +1 -0
  31. package/lib/cjs/clientErrors/ProxyAuthentificationRequired.js +12 -0
  32. package/lib/cjs/clientErrors/ProxyAuthentificationRequired.js.map +1 -0
  33. package/lib/cjs/clientErrors/RequestEntityTooLarge.js +12 -0
  34. package/lib/cjs/clientErrors/RequestEntityTooLarge.js.map +1 -0
  35. package/lib/cjs/clientErrors/RequestHeaderFieldsTooLarge.js +12 -0
  36. package/lib/cjs/clientErrors/RequestHeaderFieldsTooLarge.js.map +1 -0
  37. package/lib/cjs/clientErrors/RequestRangeUnsatisfiable.js +12 -0
  38. package/lib/cjs/clientErrors/RequestRangeUnsatisfiable.js.map +1 -0
  39. package/lib/cjs/clientErrors/RequestTimeout.js +12 -0
  40. package/lib/cjs/clientErrors/RequestTimeout.js.map +1 -0
  41. package/lib/cjs/clientErrors/RequestURITooLong.js +12 -0
  42. package/lib/cjs/clientErrors/RequestURITooLong.js.map +1 -0
  43. package/lib/cjs/clientErrors/TooManyRequests.js +12 -0
  44. package/lib/cjs/clientErrors/TooManyRequests.js.map +1 -0
  45. package/lib/cjs/clientErrors/Unauthorized.js +12 -0
  46. package/lib/cjs/clientErrors/Unauthorized.js.map +1 -0
  47. package/lib/cjs/clientErrors/UnavailableForLegalReasons.js +12 -0
  48. package/lib/cjs/clientErrors/UnavailableForLegalReasons.js.map +1 -0
  49. package/lib/cjs/clientErrors/UnprocessableEntity.js +12 -0
  50. package/lib/cjs/clientErrors/UnprocessableEntity.js.map +1 -0
  51. package/lib/cjs/clientErrors/UnsupportedMediaType.js +12 -0
  52. package/lib/cjs/clientErrors/UnsupportedMediaType.js.map +1 -0
  53. package/lib/cjs/clientErrors/UpgradeRequired.js +12 -0
  54. package/lib/cjs/clientErrors/UpgradeRequired.js.map +1 -0
  55. package/lib/cjs/core/Exception.js +66 -0
  56. package/lib/cjs/core/Exception.js.map +1 -0
  57. package/lib/cjs/index.js +53 -0
  58. package/lib/cjs/index.js.map +1 -0
  59. package/lib/cjs/package.json +3 -0
  60. package/lib/cjs/redirections/MovedPermanently.js +12 -0
  61. package/lib/cjs/redirections/MovedPermanently.js.map +1 -0
  62. package/lib/cjs/redirections/MovedTemporarily.js +13 -0
  63. package/lib/cjs/redirections/MovedTemporarily.js.map +1 -0
  64. package/lib/cjs/redirections/MultipleChoices.js +12 -0
  65. package/lib/cjs/redirections/MultipleChoices.js.map +1 -0
  66. package/lib/cjs/redirections/NotModified.js +12 -0
  67. package/lib/cjs/redirections/NotModified.js.map +1 -0
  68. package/lib/cjs/redirections/PermanentRedirect.js +12 -0
  69. package/lib/cjs/redirections/PermanentRedirect.js.map +1 -0
  70. package/lib/cjs/redirections/SeeOther.js +12 -0
  71. package/lib/cjs/redirections/SeeOther.js.map +1 -0
  72. package/lib/cjs/redirections/TemporaryRedirect.js +12 -0
  73. package/lib/cjs/redirections/TemporaryRedirect.js.map +1 -0
  74. package/lib/cjs/redirections/UseProxy.js +12 -0
  75. package/lib/cjs/redirections/UseProxy.js.map +1 -0
  76. package/lib/cjs/serverErrors/BadGateway.js +12 -0
  77. package/lib/cjs/serverErrors/BadGateway.js.map +1 -0
  78. package/lib/cjs/serverErrors/BandwidthLimitExceeded.js +12 -0
  79. package/lib/cjs/serverErrors/BandwidthLimitExceeded.js.map +1 -0
  80. package/lib/cjs/serverErrors/GatewayTimeout.js +12 -0
  81. package/lib/cjs/serverErrors/GatewayTimeout.js.map +1 -0
  82. package/lib/cjs/serverErrors/InternalServerError.js +12 -0
  83. package/lib/cjs/serverErrors/InternalServerError.js.map +1 -0
  84. package/lib/cjs/serverErrors/NetworkAuthenticationRequired.js +12 -0
  85. package/lib/cjs/serverErrors/NetworkAuthenticationRequired.js.map +1 -0
  86. package/lib/cjs/serverErrors/NotExtended.js +12 -0
  87. package/lib/cjs/serverErrors/NotExtended.js.map +1 -0
  88. package/lib/cjs/serverErrors/NotImplemented.js +12 -0
  89. package/lib/cjs/serverErrors/NotImplemented.js.map +1 -0
  90. package/lib/cjs/serverErrors/ProxyError.js +13 -0
  91. package/lib/cjs/serverErrors/ProxyError.js.map +1 -0
  92. package/lib/cjs/serverErrors/ServiceUnvailable.js +12 -0
  93. package/lib/cjs/serverErrors/ServiceUnvailable.js.map +1 -0
  94. package/lib/cjs/serverErrors/VariantAlsoNegotiates.js +12 -0
  95. package/lib/cjs/serverErrors/VariantAlsoNegotiates.js.map +1 -0
  96. package/lib/esm/clientErrors/BadMapping.js +9 -0
  97. package/lib/esm/clientErrors/BadMapping.js.map +1 -0
  98. package/lib/esm/clientErrors/BadRequest.js +8 -0
  99. package/lib/esm/clientErrors/BadRequest.js.map +1 -0
  100. package/lib/esm/clientErrors/Conflict.js +8 -0
  101. package/lib/esm/clientErrors/Conflict.js.map +1 -0
  102. package/lib/esm/clientErrors/ExpectationFailed.js +8 -0
  103. package/lib/esm/clientErrors/ExpectationFailed.js.map +1 -0
  104. package/lib/esm/clientErrors/Forbidden.js +8 -0
  105. package/lib/esm/clientErrors/Forbidden.js.map +1 -0
  106. package/lib/esm/clientErrors/Gone.js +8 -0
  107. package/lib/esm/clientErrors/Gone.js.map +1 -0
  108. package/lib/esm/clientErrors/ImATeapot.js +9 -0
  109. package/lib/esm/clientErrors/ImATeapot.js.map +1 -0
  110. package/lib/esm/clientErrors/LengthRequired.js +8 -0
  111. package/lib/esm/clientErrors/LengthRequired.js.map +1 -0
  112. package/lib/esm/clientErrors/MethodNotAllowed.js +8 -0
  113. package/lib/esm/clientErrors/MethodNotAllowed.js.map +1 -0
  114. package/lib/esm/clientErrors/MisdirectedRequest.js +8 -0
  115. package/lib/esm/clientErrors/MisdirectedRequest.js.map +1 -0
  116. package/lib/esm/clientErrors/NotAcceptable.js +8 -0
  117. package/lib/esm/clientErrors/NotAcceptable.js.map +1 -0
  118. package/lib/esm/clientErrors/NotFound.js +8 -0
  119. package/lib/esm/clientErrors/NotFound.js.map +1 -0
  120. package/lib/esm/clientErrors/PaymentRequired.js +8 -0
  121. package/lib/esm/clientErrors/PaymentRequired.js.map +1 -0
  122. package/lib/esm/clientErrors/PreconditionFailed.js +8 -0
  123. package/lib/esm/clientErrors/PreconditionFailed.js.map +1 -0
  124. package/lib/esm/clientErrors/PreconditionRequired.js +8 -0
  125. package/lib/esm/clientErrors/PreconditionRequired.js.map +1 -0
  126. package/lib/esm/clientErrors/ProxyAuthentificationRequired.js +8 -0
  127. package/lib/esm/clientErrors/ProxyAuthentificationRequired.js.map +1 -0
  128. package/lib/esm/clientErrors/RequestEntityTooLarge.js +8 -0
  129. package/lib/esm/clientErrors/RequestEntityTooLarge.js.map +1 -0
  130. package/lib/esm/clientErrors/RequestHeaderFieldsTooLarge.js +8 -0
  131. package/lib/esm/clientErrors/RequestHeaderFieldsTooLarge.js.map +1 -0
  132. package/lib/esm/clientErrors/RequestRangeUnsatisfiable.js +8 -0
  133. package/lib/esm/clientErrors/RequestRangeUnsatisfiable.js.map +1 -0
  134. package/lib/esm/clientErrors/RequestTimeout.js +8 -0
  135. package/lib/esm/clientErrors/RequestTimeout.js.map +1 -0
  136. package/lib/esm/clientErrors/RequestURITooLong.js +8 -0
  137. package/lib/esm/clientErrors/RequestURITooLong.js.map +1 -0
  138. package/lib/esm/clientErrors/TooManyRequests.js +8 -0
  139. package/lib/esm/clientErrors/TooManyRequests.js.map +1 -0
  140. package/lib/esm/clientErrors/Unauthorized.js +8 -0
  141. package/lib/esm/clientErrors/Unauthorized.js.map +1 -0
  142. package/lib/esm/clientErrors/UnavailableForLegalReasons.js +8 -0
  143. package/lib/esm/clientErrors/UnavailableForLegalReasons.js.map +1 -0
  144. package/lib/esm/clientErrors/UnprocessableEntity.js +8 -0
  145. package/lib/esm/clientErrors/UnprocessableEntity.js.map +1 -0
  146. package/lib/esm/clientErrors/UnsupportedMediaType.js +8 -0
  147. package/lib/esm/clientErrors/UnsupportedMediaType.js.map +1 -0
  148. package/lib/esm/clientErrors/UpgradeRequired.js +8 -0
  149. package/lib/esm/clientErrors/UpgradeRequired.js.map +1 -0
  150. package/lib/esm/core/Exception.js +60 -0
  151. package/lib/esm/core/Exception.js.map +1 -0
  152. package/lib/esm/index.js +50 -0
  153. package/lib/esm/index.js.map +1 -0
  154. package/lib/esm/package.json +3 -0
  155. package/lib/esm/redirections/MovedPermanently.js +8 -0
  156. package/lib/esm/redirections/MovedPermanently.js.map +1 -0
  157. package/lib/esm/redirections/MovedTemporarily.js +9 -0
  158. package/lib/esm/redirections/MovedTemporarily.js.map +1 -0
  159. package/lib/esm/redirections/MultipleChoices.js +8 -0
  160. package/lib/esm/redirections/MultipleChoices.js.map +1 -0
  161. package/lib/esm/redirections/NotModified.js +8 -0
  162. package/lib/esm/redirections/NotModified.js.map +1 -0
  163. package/lib/esm/redirections/PermanentRedirect.js +8 -0
  164. package/lib/esm/redirections/PermanentRedirect.js.map +1 -0
  165. package/lib/esm/redirections/SeeOther.js +8 -0
  166. package/lib/esm/redirections/SeeOther.js.map +1 -0
  167. package/lib/esm/redirections/TemporaryRedirect.js +8 -0
  168. package/lib/esm/redirections/TemporaryRedirect.js.map +1 -0
  169. package/lib/esm/redirections/UseProxy.js +8 -0
  170. package/lib/esm/redirections/UseProxy.js.map +1 -0
  171. package/lib/esm/serverErrors/BadGateway.js +8 -0
  172. package/lib/esm/serverErrors/BadGateway.js.map +1 -0
  173. package/lib/esm/serverErrors/BandwidthLimitExceeded.js +8 -0
  174. package/lib/esm/serverErrors/BandwidthLimitExceeded.js.map +1 -0
  175. package/lib/esm/serverErrors/GatewayTimeout.js +8 -0
  176. package/lib/esm/serverErrors/GatewayTimeout.js.map +1 -0
  177. package/lib/esm/serverErrors/InternalServerError.js +8 -0
  178. package/lib/esm/serverErrors/InternalServerError.js.map +1 -0
  179. package/lib/esm/serverErrors/NetworkAuthenticationRequired.js +8 -0
  180. package/lib/esm/serverErrors/NetworkAuthenticationRequired.js.map +1 -0
  181. package/lib/esm/serverErrors/NotExtended.js +8 -0
  182. package/lib/esm/serverErrors/NotExtended.js.map +1 -0
  183. package/lib/esm/serverErrors/NotImplemented.js +8 -0
  184. package/lib/esm/serverErrors/NotImplemented.js.map +1 -0
  185. package/lib/esm/serverErrors/ProxyError.js +9 -0
  186. package/lib/esm/serverErrors/ProxyError.js.map +1 -0
  187. package/lib/esm/serverErrors/ServiceUnvailable.js +8 -0
  188. package/lib/esm/serverErrors/ServiceUnvailable.js.map +1 -0
  189. package/lib/esm/serverErrors/VariantAlsoNegotiates.js +8 -0
  190. package/lib/esm/serverErrors/VariantAlsoNegotiates.js.map +1 -0
  191. package/lib/{clientErrors → types/clientErrors}/BadMapping.d.ts +0 -0
  192. package/lib/{clientErrors → types/clientErrors}/BadRequest.d.ts +0 -0
  193. package/lib/{clientErrors → types/clientErrors}/Conflict.d.ts +0 -0
  194. package/lib/{clientErrors → types/clientErrors}/ExpectationFailed.d.ts +0 -0
  195. package/lib/{clientErrors → types/clientErrors}/Forbidden.d.ts +0 -0
  196. package/lib/{clientErrors → types/clientErrors}/Gone.d.ts +0 -0
  197. package/lib/{clientErrors → types/clientErrors}/ImATeapot.d.ts +0 -0
  198. package/lib/{clientErrors → types/clientErrors}/LengthRequired.d.ts +0 -0
  199. package/lib/{clientErrors → types/clientErrors}/MethodNotAllowed.d.ts +0 -0
  200. package/lib/{clientErrors → types/clientErrors}/MisdirectedRequest.d.ts +0 -0
  201. package/lib/{clientErrors → types/clientErrors}/NotAcceptable.d.ts +0 -0
  202. package/lib/{clientErrors → types/clientErrors}/NotFound.d.ts +0 -0
  203. package/lib/{clientErrors → types/clientErrors}/PaymentRequired.d.ts +0 -0
  204. package/lib/{clientErrors → types/clientErrors}/PreconditionFailed.d.ts +0 -0
  205. package/lib/{clientErrors → types/clientErrors}/PreconditionRequired.d.ts +0 -0
  206. package/lib/{clientErrors → types/clientErrors}/ProxyAuthentificationRequired.d.ts +0 -0
  207. package/lib/{clientErrors → types/clientErrors}/RequestEntityTooLarge.d.ts +0 -0
  208. package/lib/{clientErrors → types/clientErrors}/RequestHeaderFieldsTooLarge.d.ts +0 -0
  209. package/lib/{clientErrors → types/clientErrors}/RequestRangeUnsatisfiable.d.ts +0 -0
  210. package/lib/{clientErrors → types/clientErrors}/RequestTimeout.d.ts +0 -0
  211. package/lib/{clientErrors → types/clientErrors}/RequestURITooLong.d.ts +0 -0
  212. package/lib/{clientErrors → types/clientErrors}/TooManyRequests.d.ts +0 -0
  213. package/lib/{clientErrors → types/clientErrors}/Unauthorized.d.ts +0 -0
  214. package/lib/{clientErrors → types/clientErrors}/UnavailableForLegalReasons.d.ts +0 -0
  215. package/lib/{clientErrors → types/clientErrors}/UnprocessableEntity.d.ts +0 -0
  216. package/lib/{clientErrors → types/clientErrors}/UnsupportedMediaType.d.ts +0 -0
  217. package/lib/{clientErrors → types/clientErrors}/UpgradeRequired.d.ts +0 -0
  218. package/lib/{core → types/core}/Exception.d.ts +0 -0
  219. package/lib/types/index.d.ts +49 -0
  220. package/lib/{redirections → types/redirections}/MovedPermanently.d.ts +0 -0
  221. package/lib/{redirections → types/redirections}/MovedTemporarily.d.ts +0 -0
  222. package/lib/{redirections → types/redirections}/MultipleChoices.d.ts +0 -0
  223. package/lib/{redirections → types/redirections}/NotModified.d.ts +0 -0
  224. package/lib/{redirections → types/redirections}/PermanentRedirect.d.ts +0 -0
  225. package/lib/{redirections → types/redirections}/SeeOther.d.ts +0 -0
  226. package/lib/{redirections → types/redirections}/TemporaryRedirect.d.ts +0 -0
  227. package/lib/{redirections → types/redirections}/UseProxy.d.ts +0 -0
  228. package/lib/{serverErrors → types/serverErrors}/BadGateway.d.ts +0 -0
  229. package/lib/{serverErrors → types/serverErrors}/BandwidthLimitExceeded.d.ts +0 -0
  230. package/lib/{serverErrors → types/serverErrors}/GatewayTimeout.d.ts +0 -0
  231. package/lib/{serverErrors → types/serverErrors}/InternalServerError.d.ts +0 -0
  232. package/lib/{serverErrors → types/serverErrors}/NetworkAuthenticationRequired.d.ts +0 -0
  233. package/lib/{serverErrors → types/serverErrors}/NotExtended.d.ts +0 -0
  234. package/lib/{serverErrors → types/serverErrors}/NotImplemented.d.ts +0 -0
  235. package/lib/{serverErrors → types/serverErrors}/ProxyError.d.ts +0 -0
  236. package/lib/{serverErrors → types/serverErrors}/ServiceUnvailable.d.ts +0 -0
  237. package/lib/{serverErrors → types/serverErrors}/VariantAlsoNegotiates.d.ts +0 -0
  238. package/package.json +20 -14
  239. package/readme.md +1 -2
  240. package/tsconfig.compile.esm.json +12 -0
  241. package/lib/clientErrors/index.d.ts +0 -27
  242. package/lib/constants/statuses.d.ts +0 -4
  243. package/lib/core/index.d.ts +0 -1
  244. package/lib/index.d.ts +0 -5
  245. package/lib/index.js +0 -505
  246. package/lib/index.js.map +0 -1
  247. package/lib/index.modern.js +0 -457
  248. package/lib/index.modern.js.map +0 -1
  249. package/lib/redirections/TooManyRedirects.d.ts +0 -5
  250. package/lib/redirections/index.d.ts +0 -9
  251. package/lib/serverErrors/index.d.ts +0 -10
@@ -1,457 +0,0 @@
1
- import { getStatusConstant, HTTP_STATUS_MESSAGES } from '@tsed/schema';
2
-
3
- function _extends() {
4
- _extends = Object.assign || function (target) {
5
- for (var i = 1; i < arguments.length; i++) {
6
- var source = arguments[i];
7
-
8
- for (var key in source) {
9
- if (Object.prototype.hasOwnProperty.call(source, key)) {
10
- target[key] = source[key];
11
- }
12
- }
13
- }
14
-
15
- return target;
16
- };
17
-
18
- return _extends.apply(this, arguments);
19
- }
20
-
21
- class Exception extends Error {
22
- constructor(status = 500, message = "", origin) {
23
- super(message);
24
- /**
25
- * Exception base name
26
- * @type {string}
27
- */
28
-
29
- this.name = "HTTP_EXCEPTION";
30
- /**
31
- * Exception type
32
- * @type {string}
33
- */
34
-
35
- this.type = "HTTP_EXCEPTION";
36
- /**
37
- * Headers must be sent to the response
38
- */
39
-
40
- this.headers = {};
41
- this.status = status;
42
- this.message = message;
43
- this.name = getStatusConstant(status);
44
- this.setOrigin(origin);
45
- }
46
-
47
- setHeaders(headers) {
48
- this.headers = _extends({}, this.headers, headers);
49
- return this;
50
- }
51
-
52
- setHeader(key, value) {
53
- this.headers[key] = value;
54
- return this;
55
- }
56
-
57
- setOrigin(origin) {
58
- if (origin) {
59
- if (origin instanceof Error) {
60
- this.origin = origin;
61
- this.message = `${this.message}, innerException: ${this.origin.message}`.trim();
62
- } else if (typeof origin === "string") {
63
- this.origin = new Error(origin);
64
- this.message = `${this.message}, innerException: ${this.origin.message}`.trim();
65
- } else {
66
- this.body = origin;
67
- }
68
- }
69
- }
70
-
71
- toString() {
72
- return `${this.name}(${this.status}): ${this.message} `.trim();
73
- }
74
-
75
- }
76
- class HTTPException extends Exception {}
77
-
78
- /**
79
- *
80
- */
81
-
82
- const HTTP_STATUSES = HTTP_STATUS_MESSAGES;
83
-
84
- class BadMapping extends Exception {
85
- constructor(message, origin) {
86
- super(BadMapping.STATUS, message, origin);
87
- this.name = "BAD_MAPPING";
88
- }
89
-
90
- }
91
- BadMapping.STATUS = 421;
92
-
93
- class BadRequest extends Exception {
94
- constructor(message, origin) {
95
- super(BadRequest.STATUS, message, origin);
96
- }
97
-
98
- }
99
- BadRequest.STATUS = 400;
100
-
101
- class Conflict extends Exception {
102
- constructor(message, origin) {
103
- super(Conflict.STATUS, message, origin);
104
- }
105
-
106
- }
107
- Conflict.STATUS = 409;
108
-
109
- class ExpectationFailed extends Exception {
110
- constructor(message, origin) {
111
- super(ExpectationFailed.STATUS, message, origin);
112
- }
113
-
114
- }
115
- ExpectationFailed.STATUS = 417;
116
-
117
- class Forbidden extends Exception {
118
- constructor(message, origin) {
119
- super(Forbidden.STATUS, message, origin);
120
- }
121
-
122
- }
123
- Forbidden.STATUS = 403;
124
-
125
- class Gone extends Exception {
126
- constructor(message, origin) {
127
- super(Gone.STATUS, message, origin);
128
- }
129
-
130
- }
131
- Gone.STATUS = 410;
132
-
133
- class ImATeapot extends Exception {
134
- constructor(message, origin) {
135
- super(ImATeapot.STATUS, message, origin);
136
- this.name = "IM_A_TEAPOT";
137
- }
138
-
139
- }
140
- ImATeapot.STATUS = 418;
141
-
142
- class LengthRequired extends Exception {
143
- constructor(message, origin) {
144
- super(LengthRequired.STATUS, message, origin);
145
- }
146
-
147
- }
148
- LengthRequired.STATUS = 411;
149
-
150
- class MethodNotAllowed extends Exception {
151
- constructor(message, origin) {
152
- super(MethodNotAllowed.STATUS, message, origin);
153
- }
154
-
155
- }
156
- MethodNotAllowed.STATUS = 405;
157
-
158
- class MisdirectedRequest extends Exception {
159
- constructor(message, origin) {
160
- super(MisdirectedRequest.STATUS, message, origin);
161
- }
162
-
163
- }
164
- MisdirectedRequest.STATUS = 421;
165
-
166
- class NotAcceptable extends Exception {
167
- constructor(message, origin = "You must accept content-type " + message) {
168
- super(NotAcceptable.STATUS, origin);
169
- }
170
-
171
- }
172
- NotAcceptable.STATUS = 406;
173
-
174
- class NotFound extends Exception {
175
- constructor(message, origin) {
176
- super(NotFound.STATUS, message, origin);
177
- }
178
-
179
- }
180
- NotFound.STATUS = 404;
181
-
182
- class PaymentRequired extends Exception {
183
- constructor(message, origin) {
184
- super(PaymentRequired.STATUS, message, origin);
185
- }
186
-
187
- }
188
- PaymentRequired.STATUS = 402;
189
-
190
- class PreconditionFailed extends Exception {
191
- constructor(message, origin) {
192
- super(PreconditionFailed.STATUS, message, origin);
193
- }
194
-
195
- }
196
- PreconditionFailed.STATUS = 412;
197
-
198
- class PreconditionRequired extends Exception {
199
- constructor(message, origin) {
200
- super(PreconditionRequired.STATUS, message, origin);
201
- }
202
-
203
- }
204
- PreconditionRequired.STATUS = 428;
205
-
206
- class ProxyAuthentificationRequired extends Exception {
207
- constructor(message, origin) {
208
- super(ProxyAuthentificationRequired.STATUS, message, origin);
209
- }
210
-
211
- }
212
- ProxyAuthentificationRequired.STATUS = 407;
213
-
214
- class RequestRangeUnsatisfiable extends Exception {
215
- constructor(message, origin) {
216
- super(RequestRangeUnsatisfiable.STATUS, message, origin);
217
- }
218
-
219
- }
220
- RequestRangeUnsatisfiable.STATUS = 416;
221
-
222
- class RequestEntityTooLarge extends Exception {
223
- constructor(message, origin) {
224
- super(RequestEntityTooLarge.STATUS, message, origin);
225
- }
226
-
227
- }
228
- RequestEntityTooLarge.STATUS = 413;
229
-
230
- class RequestHeaderFieldsTooLarge extends Exception {
231
- constructor(message, origin) {
232
- super(RequestHeaderFieldsTooLarge.STATUS, message, origin);
233
- }
234
-
235
- }
236
- RequestHeaderFieldsTooLarge.STATUS = 431;
237
-
238
- class RequestTimeout extends Exception {
239
- constructor(message, origin) {
240
- super(RequestTimeout.STATUS, message, origin);
241
- }
242
-
243
- }
244
- RequestTimeout.STATUS = 408;
245
-
246
- class RequestURITooLong extends Exception {
247
- constructor(message, origin) {
248
- super(RequestURITooLong.STATUS, message, origin);
249
- }
250
-
251
- }
252
- RequestURITooLong.STATUS = 414;
253
-
254
- class TooManyRequests extends Exception {
255
- constructor(message, origin) {
256
- super(TooManyRequests.STATUS, message, origin);
257
- }
258
-
259
- }
260
- TooManyRequests.STATUS = 429;
261
-
262
- class Unauthorized extends Exception {
263
- constructor(message, origin) {
264
- super(Unauthorized.STATUS, message, origin);
265
- }
266
-
267
- }
268
- Unauthorized.STATUS = 401;
269
-
270
- class UnsupportedMediaType extends Exception {
271
- constructor(message, origin) {
272
- super(UnsupportedMediaType.STATUS, message, origin);
273
- }
274
-
275
- }
276
- UnsupportedMediaType.STATUS = 415;
277
-
278
- class UpgradeRequired extends Exception {
279
- constructor(message, origin) {
280
- super(UpgradeRequired.STATUS, message, origin);
281
- }
282
-
283
- }
284
- UpgradeRequired.STATUS = 426;
285
-
286
- class UnavailableForLegalReasons extends Exception {
287
- constructor(message, origin) {
288
- super(UnavailableForLegalReasons.STATUS, message, origin);
289
- }
290
-
291
- }
292
- UnavailableForLegalReasons.STATUS = 451;
293
-
294
- class UnprocessableEntity extends Exception {
295
- constructor(message, origin) {
296
- super(UnprocessableEntity.STATUS, message, origin);
297
- }
298
-
299
- }
300
- UnprocessableEntity.STATUS = 422;
301
-
302
- class MovedPermanently extends Exception {
303
- constructor(message, origin) {
304
- super(MovedPermanently.STATUS, message, origin);
305
- }
306
-
307
- }
308
- MovedPermanently.STATUS = 301;
309
-
310
- class MovedTemporarily extends Exception {
311
- constructor(message, origin) {
312
- super(MovedTemporarily.STATUS, message, origin);
313
- this.name = "MOVED_TEMPORARILY";
314
- }
315
-
316
- }
317
- MovedTemporarily.STATUS = 302;
318
-
319
- class MultipleChoices extends Exception {
320
- constructor(message, origin) {
321
- super(MultipleChoices.STATUS, message, origin);
322
- }
323
-
324
- }
325
- MultipleChoices.STATUS = 300;
326
-
327
- class NotModified extends Exception {
328
- constructor(message, origin) {
329
- super(NotModified.STATUS, message, origin);
330
- }
331
-
332
- }
333
- NotModified.STATUS = 304;
334
-
335
- class PermanentRedirect extends Exception {
336
- constructor(message, origin) {
337
- super(PermanentRedirect.STATUS, message, origin);
338
- }
339
-
340
- }
341
- PermanentRedirect.STATUS = 308;
342
-
343
- class SeeOther extends Exception {
344
- constructor(message, origin) {
345
- super(SeeOther.STATUS, message, origin);
346
- }
347
-
348
- }
349
- SeeOther.STATUS = 303;
350
-
351
- class TemporaryRedirect extends Exception {
352
- constructor(message, origin) {
353
- super(TemporaryRedirect.STATUS, message, origin);
354
- }
355
-
356
- }
357
- TemporaryRedirect.STATUS = 307;
358
-
359
- class TooManyRedirects extends Exception {
360
- constructor(message, origin) {
361
- super(TooManyRedirects.STATUS, message, origin);
362
- }
363
-
364
- }
365
- TooManyRedirects.STATUS = 310;
366
-
367
- class UseProxy extends Exception {
368
- constructor(message, origin) {
369
- super(UseProxy.STATUS, message, origin);
370
- }
371
-
372
- }
373
- UseProxy.STATUS = 305;
374
-
375
- class BadGateway extends Exception {
376
- constructor(message, origin) {
377
- super(BadGateway.STATUS, message, origin);
378
- }
379
-
380
- }
381
- BadGateway.STATUS = 502;
382
-
383
- class GatewayTimeout extends Exception {
384
- constructor(message, origin) {
385
- super(GatewayTimeout.STATUS, message, origin);
386
- }
387
-
388
- }
389
- GatewayTimeout.STATUS = 504;
390
-
391
- class InternalServerError extends Exception {
392
- constructor(message, origin) {
393
- super(InternalServerError.STATUS, message, origin);
394
- }
395
-
396
- }
397
- InternalServerError.STATUS = 500;
398
-
399
- class NotImplemented extends Exception {
400
- constructor(message, origin) {
401
- super(NotImplemented.STATUS, message, origin);
402
- }
403
-
404
- }
405
- NotImplemented.STATUS = 501;
406
-
407
- class ProxyError extends Exception {
408
- constructor(message, origin) {
409
- super(ProxyError.STATUS, message, origin);
410
- this.name = "PROXY_ERROR";
411
- }
412
-
413
- }
414
- ProxyError.STATUS = 502;
415
-
416
- class ServiceUnvailable extends Exception {
417
- constructor(message, origin) {
418
- super(ServiceUnvailable.STATUS, message, origin);
419
- }
420
-
421
- }
422
- ServiceUnvailable.STATUS = 503;
423
-
424
- class NetworkAuthenticationRequired extends Exception {
425
- constructor(message, origin) {
426
- super(NetworkAuthenticationRequired.STATUS, message, origin);
427
- }
428
-
429
- }
430
- NetworkAuthenticationRequired.STATUS = 511;
431
-
432
- class NotExtended extends Exception {
433
- constructor(message, origin) {
434
- super(NotExtended.STATUS, message, origin);
435
- }
436
-
437
- }
438
- NotExtended.STATUS = 510;
439
-
440
- class VariantAlsoNegotiates extends Exception {
441
- constructor(message, origin) {
442
- super(VariantAlsoNegotiates.STATUS, message, origin);
443
- }
444
-
445
- }
446
- VariantAlsoNegotiates.STATUS = 506;
447
-
448
- class BandwidthLimitExceeded extends Exception {
449
- constructor(message, origin) {
450
- super(BandwidthLimitExceeded.STATUS, message, origin);
451
- }
452
-
453
- }
454
- BandwidthLimitExceeded.STATUS = 509;
455
-
456
- export { BadGateway, BadMapping, BadRequest, BandwidthLimitExceeded, Conflict, Exception, ExpectationFailed, Forbidden, GatewayTimeout, Gone, HTTPException, HTTP_STATUSES, ImATeapot, InternalServerError, LengthRequired, MethodNotAllowed, MisdirectedRequest, MovedPermanently, MovedTemporarily, MultipleChoices, NetworkAuthenticationRequired, NotAcceptable, NotExtended, NotFound, NotImplemented, NotModified, PaymentRequired, PermanentRedirect, PreconditionFailed, PreconditionRequired, ProxyAuthentificationRequired, ProxyError, RequestEntityTooLarge, RequestHeaderFieldsTooLarge, RequestRangeUnsatisfiable, RequestTimeout, RequestURITooLong, SeeOther, ServiceUnvailable, TemporaryRedirect, TooManyRedirects, TooManyRequests, Unauthorized, UnavailableForLegalReasons, UnprocessableEntity, UnsupportedMediaType, UpgradeRequired, UseProxy, VariantAlsoNegotiates };
457
- //# sourceMappingURL=index.modern.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.modern.js","sources":["../src/core/Exception.ts","../src/constants/statuses.ts","../src/clientErrors/BadMapping.ts","../src/clientErrors/BadRequest.ts","../src/clientErrors/Conflict.ts","../src/clientErrors/ExpectationFailed.ts","../src/clientErrors/Forbidden.ts","../src/clientErrors/Gone.ts","../src/clientErrors/ImATeapot.ts","../src/clientErrors/LengthRequired.ts","../src/clientErrors/MethodNotAllowed.ts","../src/clientErrors/MisdirectedRequest.ts","../src/clientErrors/NotAcceptable.ts","../src/clientErrors/NotFound.ts","../src/clientErrors/PaymentRequired.ts","../src/clientErrors/PreconditionFailed.ts","../src/clientErrors/PreconditionRequired.ts","../src/clientErrors/ProxyAuthentificationRequired.ts","../src/clientErrors/RequestRangeUnsatisfiable.ts","../src/clientErrors/RequestEntityTooLarge.ts","../src/clientErrors/RequestHeaderFieldsTooLarge.ts","../src/clientErrors/RequestTimeout.ts","../src/clientErrors/RequestURITooLong.ts","../src/clientErrors/TooManyRequests.ts","../src/clientErrors/Unauthorized.ts","../src/clientErrors/UnsupportedMediaType.ts","../src/clientErrors/UpgradeRequired.ts","../src/clientErrors/UnavailableForLegalReasons.ts","../src/clientErrors/UnprocessableEntity.ts","../src/redirections/MovedPermanently.ts","../src/redirections/MovedTemporarily.ts","../src/redirections/MultipleChoices.ts","../src/redirections/NotModified.ts","../src/redirections/PermanentRedirect.ts","../src/redirections/SeeOther.ts","../src/redirections/TemporaryRedirect.ts","../src/redirections/TooManyRedirects.ts","../src/redirections/UseProxy.ts","../src/serverErrors/BadGateway.ts","../src/serverErrors/GatewayTimeout.ts","../src/serverErrors/InternalServerError.ts","../src/serverErrors/NotImplemented.ts","../src/serverErrors/ProxyError.ts","../src/serverErrors/ServiceUnvailable.ts","../src/serverErrors/NetworkAuthenticationRequired.ts","../src/serverErrors/NotExtended.ts","../src/serverErrors/VariantAlsoNegotiates.ts","../src/serverErrors/BandwidthLimitExceeded.ts"],"sourcesContent":["import {getStatusConstant} from \"@tsed/schema\";\n\nexport class Exception extends Error {\n /**\n * Exception base name\n * @type {string}\n */\n public name: string = \"HTTP_EXCEPTION\";\n /**\n * Message of the exception\n */\n public message: string;\n /**\n * Exception type\n * @type {string}\n */\n public type: string = \"HTTP_EXCEPTION\";\n /**\n * Stack calling\n */\n public stack: string;\n public origin: Error & any;\n /**\n * HTTP Code Status\n */\n public status: number;\n /**\n *\n */\n public body: any;\n /**\n * Headers must be sent to the response\n */\n public headers: {[key: string]: any} = {};\n\n [key: string]: any;\n\n constructor(status: number = 500, message: string = \"\", origin?: Error | string | any) {\n super(message);\n\n this.status = status;\n this.message = message;\n this.name = getStatusConstant(status);\n\n this.setOrigin(origin);\n }\n\n setHeaders(headers: {[key: string]: any}) {\n this.headers = {\n ...this.headers,\n ...headers\n };\n\n return this;\n }\n\n setHeader(key: string, value: any) {\n this.headers[key] = value;\n\n return this;\n }\n\n setOrigin(origin: Error | string | any) {\n if (origin) {\n if (origin instanceof Error) {\n this.origin = origin;\n this.message = `${this.message}, innerException: ${this.origin.message}`.trim();\n } else if (typeof origin === \"string\") {\n this.origin = new Error(origin);\n this.message = `${this.message}, innerException: ${this.origin.message}`.trim();\n } else {\n this.body = origin;\n }\n }\n }\n\n toString() {\n return `${this.name}(${this.status}): ${this.message} `.trim();\n }\n}\n\nexport class HTTPException extends Exception {}\n","import {HTTP_STATUS_MESSAGES} from \"@tsed/schema\";\n\n/**\n *\n */\nexport const HTTP_STATUSES: any = HTTP_STATUS_MESSAGES;\n","import {Exception} from \"../core/Exception\";\n\nexport class BadMapping extends Exception {\n static readonly STATUS = 421;\n name: string = \"BAD_MAPPING\";\n\n constructor(message: string, origin?: Error | string | any) {\n super(BadMapping.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class BadRequest extends Exception {\n static readonly STATUS = 400;\n\n constructor(message: string, origin?: Error | string | any) {\n super(BadRequest.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class Conflict extends Exception {\n static readonly STATUS = 409;\n\n constructor(message: string, origin?: Error | string | any) {\n super(Conflict.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class ExpectationFailed extends Exception {\n static readonly STATUS = 417;\n\n constructor(message: string, origin?: Error | string | any) {\n super(ExpectationFailed.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class Forbidden extends Exception {\n static readonly STATUS = 403;\n\n constructor(message: string, origin?: Error | string | any) {\n super(Forbidden.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class Gone extends Exception {\n static readonly STATUS = 410;\n\n constructor(message: string, origin?: Error | string | any) {\n super(Gone.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class ImATeapot extends Exception {\n static readonly STATUS = 418;\n name: string = \"IM_A_TEAPOT\";\n\n constructor(message: string, origin?: Error | string | any) {\n super(ImATeapot.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class LengthRequired extends Exception {\n static readonly STATUS = 411;\n\n constructor(message: string, origin?: Error | string | any) {\n super(LengthRequired.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class MethodNotAllowed extends Exception {\n static readonly STATUS = 405;\n\n constructor(message: string, origin?: Error | string | any) {\n super(MethodNotAllowed.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class MisdirectedRequest extends Exception {\n static readonly STATUS = 421;\n\n constructor(message: string, origin?: Error | string | any) {\n super(MisdirectedRequest.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class NotAcceptable extends Exception {\n static readonly STATUS = 406;\n\n constructor(message: string, origin: Error | string | any = \"You must accept content-type \" + message) {\n super(NotAcceptable.STATUS, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class NotFound extends Exception {\n static readonly STATUS = 404;\n\n constructor(message: string, origin?: Error | string | any) {\n super(NotFound.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class PaymentRequired extends Exception {\n static readonly STATUS = 402;\n\n constructor(message: string, origin?: Error | string | any) {\n super(PaymentRequired.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class PreconditionFailed extends Exception {\n static readonly STATUS = 412;\n\n constructor(message: string, origin?: Error | string | any) {\n super(PreconditionFailed.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class PreconditionRequired extends Exception {\n static readonly STATUS = 428;\n\n constructor(message: string, origin?: Error | string | any) {\n super(PreconditionRequired.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class ProxyAuthentificationRequired extends Exception {\n static readonly STATUS = 407;\n\n constructor(message: string, origin?: Error | string | any) {\n super(ProxyAuthentificationRequired.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class RequestRangeUnsatisfiable extends Exception {\n static readonly STATUS = 416;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestRangeUnsatisfiable.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class RequestEntityTooLarge extends Exception {\n static readonly STATUS = 413;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestEntityTooLarge.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class RequestHeaderFieldsTooLarge extends Exception {\n static readonly STATUS = 431;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestHeaderFieldsTooLarge.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class RequestTimeout extends Exception {\n static readonly STATUS = 408;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestTimeout.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class RequestURITooLong extends Exception {\n static readonly STATUS = 414;\n\n constructor(message: string, origin?: Error | string | any) {\n super(RequestURITooLong.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class TooManyRequests extends Exception {\n static readonly STATUS = 429;\n\n constructor(message: string, origin?: Error | string | any) {\n super(TooManyRequests.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class Unauthorized extends Exception {\n static readonly STATUS = 401;\n\n constructor(message: string, origin?: Error | string | any) {\n super(Unauthorized.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class UnsupportedMediaType extends Exception {\n static readonly STATUS = 415;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UnsupportedMediaType.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class UpgradeRequired extends Exception {\n static readonly STATUS = 426;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UpgradeRequired.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class UnavailableForLegalReasons extends Exception {\n static readonly STATUS = 451;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UnavailableForLegalReasons.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class UnprocessableEntity extends Exception {\n static readonly STATUS = 422;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UnprocessableEntity.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class MovedPermanently extends Exception {\n static readonly STATUS = 301;\n\n constructor(message: string, origin?: Error | string | any) {\n super(MovedPermanently.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class MovedTemporarily extends Exception {\n static readonly STATUS = 302;\n name: string = \"MOVED_TEMPORARILY\";\n\n constructor(message: string, origin?: Error | string | any) {\n super(MovedTemporarily.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class MultipleChoices extends Exception {\n static readonly STATUS = 300;\n\n constructor(message: string, origin?: Error | string | any) {\n super(MultipleChoices.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class NotModified extends Exception {\n static readonly STATUS = 304;\n\n constructor(message: string, origin?: Error | string | any) {\n super(NotModified.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class PermanentRedirect extends Exception {\n static readonly STATUS = 308;\n\n constructor(message: string, origin?: Error | string | any) {\n super(PermanentRedirect.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class SeeOther extends Exception {\n static readonly STATUS = 303;\n\n constructor(message: string, origin?: Error | string | any) {\n super(SeeOther.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class TemporaryRedirect extends Exception {\n static readonly STATUS = 307;\n\n constructor(message: string, origin?: Error | string | any) {\n super(TemporaryRedirect.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class TooManyRedirects extends Exception {\n static readonly STATUS = 310;\n\n constructor(message: string, origin?: Error | string | any) {\n super(TooManyRedirects.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class UseProxy extends Exception {\n static readonly STATUS = 305;\n\n constructor(message: string, origin?: Error | string | any) {\n super(UseProxy.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class BadGateway extends Exception {\n static readonly STATUS = 502;\n\n constructor(message: string, origin?: Error | string | any) {\n super(BadGateway.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class GatewayTimeout extends Exception {\n static readonly STATUS = 504;\n\n constructor(message: string, origin?: Error | string | any) {\n super(GatewayTimeout.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class InternalServerError extends Exception {\n static readonly STATUS = 500;\n\n constructor(message: string, origin?: Error | string | any) {\n super(InternalServerError.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class NotImplemented extends Exception {\n static readonly STATUS = 501;\n\n constructor(message: string, origin?: Error | string | any) {\n super(NotImplemented.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class ProxyError extends Exception {\n static readonly STATUS = 502;\n name: string = \"PROXY_ERROR\";\n\n constructor(message: string, origin?: Error | string | any) {\n super(ProxyError.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class ServiceUnvailable extends Exception {\n static readonly STATUS = 503;\n\n constructor(message: string, origin?: Error | string | any) {\n super(ServiceUnvailable.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class NetworkAuthenticationRequired extends Exception {\n static readonly STATUS = 511;\n\n constructor(message: string, origin?: Error | string | any) {\n super(NetworkAuthenticationRequired.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class NotExtended extends Exception {\n static readonly STATUS = 510;\n\n constructor(message: string, origin?: Error | string | any) {\n super(NotExtended.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class VariantAlsoNegotiates extends Exception {\n static readonly STATUS = 506;\n\n constructor(message: string, origin?: Error | string | any) {\n super(VariantAlsoNegotiates.STATUS, message, origin);\n }\n}\n","import {Exception} from \"../core/Exception\";\n\nexport class BandwidthLimitExceeded extends Exception {\n static readonly STATUS = 509;\n\n constructor(message: string, origin?: Error | string | any) {\n super(BandwidthLimitExceeded.STATUS, message, origin);\n }\n}\n"],"names":["Exception","Error","constructor","status","message","origin","name","getStatusConstant","setOrigin","setHeaders","headers","setHeader","key","value","trim","body","toString","HTTPException","HTTP_STATUSES","HTTP_STATUS_MESSAGES","BadMapping","STATUS","BadRequest","Conflict","ExpectationFailed","Forbidden","Gone","ImATeapot","LengthRequired","MethodNotAllowed","MisdirectedRequest","NotAcceptable","NotFound","PaymentRequired","PreconditionFailed","PreconditionRequired","ProxyAuthentificationRequired","RequestRangeUnsatisfiable","RequestEntityTooLarge","RequestHeaderFieldsTooLarge","RequestTimeout","RequestURITooLong","TooManyRequests","Unauthorized","UnsupportedMediaType","UpgradeRequired","UnavailableForLegalReasons","UnprocessableEntity","MovedPermanently","MovedTemporarily","MultipleChoices","NotModified","PermanentRedirect","SeeOther","TemporaryRedirect","TooManyRedirects","UseProxy","BadGateway","GatewayTimeout","InternalServerError","NotImplemented","ProxyError","ServiceUnvailable","NetworkAuthenticationRequired","NotExtended","VariantAlsoNegotiates","BandwidthLimitExceeded"],"mappings":";;;;;;;;;;;;;;;;;;;;MAEaA,kBAAkBC;AAmC7BC,EAAAA,YAAYC,SAAiB,KAAKC,UAAkB,IAAIC;AACtD,UAAMD,OAAN;AAnCF;;;;;AAIO,aAAA,GAAe,gBAAf;AAKP;;;;;AAIO,aAAA,GAAe,gBAAf;AAcP;;;;AAGO,gBAAA,GAAgC,EAAhC;AAOL,SAAKD,MAAL,GAAcA,MAAd;AACA,SAAKC,OAAL,GAAeA,OAAf;AACA,SAAKE,IAAL,GAAYC,iBAAiB,CAACJ,MAAD,CAA7B;AAEA,SAAKK,SAAL,CAAeH,MAAf;AACD;;AAEDI,EAAAA,UAAU,CAACC,OAAD;AACR,SAAKA,OAAL,gBACK,KAAKA,OADV,EAEKA,OAFL;AAKA,WAAO,IAAP;AACD;;AAEDC,EAAAA,SAAS,CAACC,GAAD,EAAcC,KAAd;AACP,SAAKH,OAAL,CAAaE,GAAb,IAAoBC,KAApB;AAEA,WAAO,IAAP;AACD;;AAEDL,EAAAA,SAAS,CAACH,MAAD;AACP,QAAIA,MAAJ,EAAY;AACV,UAAIA,MAAM,YAAYJ,KAAtB,EAA6B;AAC3B,aAAK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e2D,kBAAA,GAAS,GAAT;;MCDLC,8BAA8BjE;AAGzCE,EAAAA,YAAYE,SAAiBC;AAC3B,UAAM4D,qBAAqB,CAAC5C,MAA5B,EAAoCjB,OAApC,EAA6CC,MAA7C;AACD;;;AAJe4D,4BAAA,GAAS,GAAT;;MCDLC,+BAA+BlE;AAG1CE,EAAAA,YAAYE,SAAiBC;AAC3B,UAAM6D,sBAAsB,CAAC7C,MAA7B,EAAqCjB,OAArC,EAA8CC,MAA9C;AACD;;;AAJe6D,6BAAA,GAAS,GAAT;;;;"}
@@ -1,5 +0,0 @@
1
- import { Exception } from "../core/Exception";
2
- export declare class TooManyRedirects extends Exception {
3
- static readonly STATUS = 310;
4
- constructor(message: string, origin?: Error | string | any);
5
- }
@@ -1,9 +0,0 @@
1
- export * from "./MovedPermanently";
2
- export * from "./MovedTemporarily";
3
- export * from "./MultipleChoices";
4
- export * from "./NotModified";
5
- export * from "./PermanentRedirect";
6
- export * from "./SeeOther";
7
- export * from "./TemporaryRedirect";
8
- export * from "./TooManyRedirects";
9
- export * from "./UseProxy";
@@ -1,10 +0,0 @@
1
- export * from "./BadGateway";
2
- export * from "./GatewayTimeout";
3
- export * from "./InternalServerError";
4
- export * from "./NotImplemented";
5
- export * from "./ProxyError";
6
- export * from "./ServiceUnvailable";
7
- export * from "./NetworkAuthenticationRequired";
8
- export * from "./NotExtended";
9
- export * from "./VariantAlsoNegotiates";
10
- export * from "./BandwidthLimitExceeded";