Skip to content

Class: UnauthorizedHttpError\<ResourceType>

An UnauthenticatedHttpError triggers when a Solid server returns a 403 status indicating that the request is not authorized.

Type parameters

Name Type
ResourceType extends Resource

Hierarchy

UnauthorizedHttpError

Constructors

constructor

new UnauthorizedHttpError\<ResourceType>(resource, response, message?): UnauthorizedHttpError\<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

UnauthorizedHttpError\<ResourceType>

Inherited from

HttpErrorResult.constructor

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

HttpErrorResult.headers

Defined in

packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:27


isError

Readonly isError: true

Inherited from

HttpErrorResult.isError

Defined in

packages/connected/dist/results/error/ErrorResult.d.ts:5


resource

Readonly resource: ResourceType

Inherited from

HttpErrorResult.resource

Defined in

packages/connected/dist/results/error/ErrorResult.d.ts:10


response

Readonly response: Response

Response returned by the HTTP request

Inherited from

HttpErrorResult.response

Defined in

packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:32


status

Readonly status: number

The status of the HTTP request

Inherited from

HttpErrorResult.status

Defined in

packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:22


type

Readonly type: "unauthorizedError"

Overrides

HttpErrorResult.type

Defined in

packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:126


uri

Readonly uri: ResourceType["uri"]

Inherited from

HttpErrorResult.uri

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

HttpErrorResult.checkResponse

Defined in

packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:70


is

is(response): boolean

Indicates if a specific response constitutes an UnauthenticatedHttpError

Parameters

Name Type Description
response Response The request response

Returns

boolean

true if this response constitutes an UnauthenticatedHttpError

Defined in

packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:133


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

HttpErrorResult.isnt

Defined in

packages/connected-solid/src/requester/results/error/HttpErrorResult.ts:55