ServerErrorResponse
Class
ServerErrorResponse
Hierarchy
↳ ServerErrorResponse
Index
Constructors
Properties
Methods
- addHeaders
- appendHeader
- apply
- applyHeaders
- getStatusCode
- patchContext
- removeHeader
- setBody
- setHeader
- setHeaders
- setStatusCode
- badGateway
- create
- gatewayTimeout
- httpVersionNotSupported
- insufficientStorage
- internalServerError
- loopDetected
- networkAuthenticationRequired
- notExtended
- notImplemented
- serviceUnavailable
- variantAlsoNegotiates
Constructors
Protected
constructor
new ServerErrorResponse(__namedParameters: object
): ServerErrorResponse
Inherited from Response.constructor
Defined in Library/Response/Response.ts:17
Parameters:
__namedParameters: object
Name | Type |
---|---|
data | any |
message | string |
meta | any |
statusCode | HttpStatusCodes |
Returns: ServerErrorResponse
Properties
Protected
ctx
ctx: ContextInterface
Defined in Library/Response/Response.ts:7
Protected
data
data: any
Defined in Library/Response/Response.ts:15
Protected
headers
headers: object
Inherited from Response.headers
Defined in Library/Response/Response.ts:9
Type declaration
[header: string
]: string
| Array
<string
>
Protected
message
message: string
Inherited from Response.message
Defined in Library/Response/Response.ts:17
Protected
meta
meta: any
Defined in Library/Response/Response.ts:13
Protected
statusCode
statusCode: HttpStatusCodes
Inherited from Response.statusCode
Defined in Library/Response/Response.ts:11
Methods
addHeaders
addHeaders(headers: object
): this
Inherited from Response.addHeaders
Defined in Library/Response/Response.ts:54
Parameters:
Name | Type |
---|---|
headers | object |
Returns: this
appendHeader
appendHeader(header: string
, value: * string
| Array
<string
>*): void
Inherited from Response.appendHeader
Defined in Library/Response/Response.ts:66
Parameters:
Name | Type |
---|---|
header | string |
value | string | Array <string > |
Returns: void
apply
apply(): void
Defined in Library/Response/ServerErrorResponse.ts:53
Returns: void
applyHeaders
applyHeaders(): this
Inherited from Response.applyHeaders
Defined in Library/Response/Response.ts:76
Returns: this
getStatusCode
getStatusCode(): HttpStatusCodes
Inherited from Response.getStatusCode
Defined in Library/Response/Response.ts:38
Returns: HttpStatusCodes
patchContext
patchContext(ctx: ContextInterface): void
Inherited from Response.patchContext
Defined in Library/Response/Response.ts:26
Parameters:
Name | Type |
---|---|
ctx | ContextInterface |
Returns: void
removeHeader
removeHeader(header: string
): this
Inherited from Response.removeHeader
Defined in Library/Response/Response.ts:70
Parameters:
Name | Type |
---|---|
header | string |
Returns: this
setBody
setBody(body: any
): this
Inherited from Response.setBody
Defined in Library/Response/Response.ts:42
Parameters:
Name | Type |
---|---|
body | any |
Returns: this
setHeader
setHeader(header: string
, value: * string
| Array
<string
>*): this
Inherited from Response.setHeader
Defined in Library/Response/Response.ts:60
Parameters:
Name | Type |
---|---|
header | string |
value | string | Array <string > |
Returns: this
setHeaders
setHeaders(headers: object
): this
Inherited from Response.setHeaders
Defined in Library/Response/Response.ts:48
Parameters:
Name | Type |
---|---|
headers | object |
Returns: this
setStatusCode
setStatusCode(statusCode: HttpStatusCodes): this
Inherited from Response.setStatusCode
Defined in Library/Response/Response.ts:32
Parameters:
Name | Type |
---|---|
statusCode | HttpStatusCodes |
Returns: this
Static
badGateway
badGateway(message?: string
, data?: any
, meta?: Object
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:17
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | Object |
Returns: ServerErrorResponse
Static
create
create(statusCode: HttpStatusCodes, message?: string
, data?: any
, meta?: Object
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:5
Parameters:
Name | Type |
---|---|
statusCode | HttpStatusCodes |
Optional message | string |
Optional data | any |
Optional meta | Object |
Returns: ServerErrorResponse
Static
gatewayTimeout
gatewayTimeout(message?: string
, data?: any
, meta?: any
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:25
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | any |
Returns: ServerErrorResponse
Static
httpVersionNotSupported
httpVersionNotSupported(message?: string
, data?: any
, meta?: any
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:29
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | any |
Returns: ServerErrorResponse
Static
insufficientStorage
insufficientStorage(message?: string
, data?: any
, meta?: any
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:37
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | any |
Returns: ServerErrorResponse
Static
internalServerError
internalServerError(message?: string
, data?: any
, meta?: Object
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:9
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | Object |
Returns: ServerErrorResponse
Static
loopDetected
loopDetected(message?: string
, data?: any
, meta?: any
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:41
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | any |
Returns: ServerErrorResponse
Static
networkAuthenticationRequired
networkAuthenticationRequired(message?: string
, data?: any
, meta?: any
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:49
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | any |
Returns: ServerErrorResponse
Static
notExtended
notExtended(message?: string
, data?: any
, meta?: any
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:45
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | any |
Returns: ServerErrorResponse
Static
notImplemented
notImplemented(message?: string
, data?: any
, meta?: Object
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:13
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | Object |
Returns: ServerErrorResponse
Static
serviceUnavailable
serviceUnavailable(message?: string
, data?: any
, meta?: Object
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:21
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | Object |
Returns: ServerErrorResponse
Static
variantAlsoNegotiates
variantAlsoNegotiates(message?: string
, data?: any
, meta?: any
): ServerErrorResponse
Defined in Library/Response/ServerErrorResponse.ts:33
Parameters:
Name | Type |
---|---|
Optional message | string |
Optional data | any |
Optional meta | any |
Returns: ServerErrorResponse