Skip to content

Commit 5d64070

Browse files
committed
Add description to server error responses
1 parent 1a90a60 commit 5d64070

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/StatusCode/index.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -218,47 +218,47 @@ export enum StatusCode {
218218
*/
219219
UNAVAILABLE_FOR_LEGAL_REASONS = 451,
220220
/**
221-
* @description - @
221+
* @description This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.
222222
*/
223223
INTERNAL_SERVER_ERROR = 500,
224224
/**
225-
* @description - @
225+
* @description The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.
226226
*/
227227
NOT_IMPLEMENTED = 501,
228228
/**
229-
* @description - @
229+
* @description This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.
230230
*/
231231
BAD_GATEWAY = 502,
232232
/**
233-
* @description - @
233+
* @description The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent.
234234
*/
235235
SERVICE_UNAVAILABLE = 503,
236236
/**
237-
* @description - @
237+
* @description This error response is given when the server is acting as a gateway and cannot get a response in time.
238238
*/
239239
GATEWAY_TIMEOUT = 504,
240240
/**
241-
* @description - @
241+
* @description The HTTP version used in the request is not supported by the server.
242242
*/
243243
HTTP_VERSION_NOT_SUPPORTED = 505,
244244
/**
245-
* @description - @
245+
* @description The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.
246246
*/
247247
VARIANT_ALSO_NEGOTIATES = 506,
248248
/**
249-
* @description - @
249+
* @description The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request.
250250
*/
251251
INSUFFICIENT_STORAGE = 507,
252252
/**
253-
* @description - @
253+
* @description The server detected an infinite loop while processing the request.
254254
*/
255255
LOOP_DETECTED = 508,
256256
/**
257-
* @description - @
257+
* @description Further extensions to the request are required for the server to fulfill it.
258258
*/
259259
NOT_EXTENDED = 510,
260260
/**
261-
* @description - @
261+
* @description Indicates that the client needs to authenticate to gain network access.
262262
*/
263263
NETWORK_AUTHENTICATION_REQUIRED = 511,
264264
}

src/StatusDescription/index.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
export enum StatusDescription {
88
/**
9-
* @description - StatusCode 100
9+
* @description - StatusCode = 100
1010
*/
1111
CONTINUE = "This interim response indicates that the client should continue the request or ignore the response if the request is already finished.",
1212
/**
@@ -206,47 +206,47 @@ export enum StatusDescription {
206206
*/
207207
UNAVAILABLE_FOR_LEGAL_REASONS = "The user agent requested a resource that cannot legally be provided, such as a web page censored by a government.",
208208
/**
209-
* @description - StatusCode 500
209+
* @description - StatusCode = 500
210210
*/
211211
INTERNAL_SERVER_ERROR = "The server has encountered a situation it does not know how to handle.",
212212
/**
213-
* @description - StatusCode =
213+
* @description - StatusCode = 501
214214
*/
215215
NOT_IMPLEMENTED = "The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.",
216216
/**
217-
* @description - StatusCode =
217+
* @description - StatusCode = 502
218218
*/
219219
BAD_GATEWAY = "This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.",
220220
/**
221-
* @description - StatusCode =
221+
* @description - StatusCode = 503
222222
*/
223223
SERVICE_UNAVAILABLE = "The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This response should be used for temporary conditions and the Retry-After HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.",
224224
/**
225-
* @description - StatusCode =
225+
* @description - StatusCode = 504
226226
*/
227227
GATEWAY_TIMEOUT = "This error response is given when the server is acting as a gateway and cannot get a response in time.",
228228
/**
229-
* @description - StatusCode =
229+
* @description - StatusCode = 505
230230
*/
231231
HTTP_VERSION_NOT_SUPPORTED = "The HTTP version used in the request is not supported by the server.",
232232
/**
233-
* @description - StatusCode =
233+
* @description - StatusCode = 506
234234
*/
235235
VARIANT_ALSO_NEGOTIATES = "The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.",
236236
/**
237-
* @description - StatusCode =
237+
* @description - StatusCode = 507
238238
*/
239239
INSUFFICIENT_STORAGE = "The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request.",
240240
/**
241-
* @description - StatusCode =
241+
* @description - StatusCode = 508
242242
*/
243243
LOOP_DETECTED = "The server detected an infinite loop while processing the request.",
244244
/**
245-
* @description - StatusCode =
245+
* @description - StatusCode = 510
246246
*/
247247
NOT_EXTENDED = "Further extensions to the request are required for the server to fulfill it.",
248248
/**
249-
* @description - StatusCode =
249+
* @description - StatusCode = 511
250250
*/
251251
NETWORK_AUTHENTICATION_REQUIRED = "Indicates that the client needs to authenticate to gain network access.",
252252
}

0 commit comments

Comments
 (0)