Class: ServerHttpError\<ResourceType>
A ServerHttpError triggers when a Solid server returns a 5XX status, indicating that an error happened on the server.
Type parameters
Name | Type |
---|---|
ResourceType |
extends Resource |
Hierarchy
HttpErrorResult
\<ResourceType
>
↳ ServerHttpError
Constructors
constructor
• new ServerHttpError\<ResourceType
>(resource
, response
, message?
): ServerHttpError
\<ResourceType
>
Type parameters
Name | Type |
---|---|
ResourceType |
extends Resource \<string > |
Parameters
Name | Type | Description |
---|---|---|
resource |
ResourceType |
the resource |
response |
Response |
The response returned by the HTTP requests |
message? |
string |
A custom message for the error |
Returns
ServerHttpError
\<ResourceType
>
Inherited from
Defined in
packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:39
Properties
headers
• Readonly
headers: Headers
Headers returned by the HTTP request
Inherited from
Defined in
packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:27
isError
• Readonly
isError: true
Inherited from
Defined in
packages/connected/dist/results/error/ErrorResult.d.ts:5
resource
• Readonly
resource: ResourceType
Inherited from
Defined in
packages/connected/dist/results/error/ErrorResult.d.ts:10
response
• Readonly
response: Response
Response returned by the HTTP request
Inherited from
Defined in
packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:32
status
• Readonly
status: number
The status of the HTTP request
Inherited from
Defined in
packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:22
type
• Readonly
type: "serverError"
Overrides
Defined in
packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:166
uri
• Readonly
uri: ResourceType
["uri"
]
Inherited from
Defined in
packages/connected/dist/results/error/ErrorResult.d.ts:9
Methods
checkResponse
▸ checkResponse\<ResourceType
>(resource
, response
): undefined
| HttpErrorResultType
\<ResourceType
>
Checks a given response to see if it is a ServerHttpError, an UnauthenticatedHttpError or a some unexpected error.
Type parameters
Name | Type |
---|---|
ResourceType |
extends Resource \<string > |
Parameters
Name | Type | Description |
---|---|---|
resource |
ResourceType |
- |
response |
Response |
The response of the request |
Returns
undefined
| HttpErrorResultType
\<ResourceType
>
An error if the response calls for it. Undefined if not.
Inherited from
Defined in
packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:70
is
▸ is(response
): boolean
Indicates if a specific response constitutes a ServerHttpError
Parameters
Name | Type | Description |
---|---|---|
response |
Response |
The request response |
Returns
boolean
true if this response constitutes a ServerHttpError
Defined in
packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:173
isnt
▸ isnt(response
): boolean
Checks to see if a given response does not constitute an HTTP Error
Parameters
Name | Type | Description |
---|---|---|
response |
Response |
The response of the request |
Returns
boolean
true if the response does not constitute an HTTP Error
Inherited from
Defined in
packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:55