Skip to content

RequestUrlError

The error requestUrlEx and requestUrlStream throw for a status code of 400 or higher.

Import:

import { RequestUrlError } from '@mnaoumov/obsidian-lib/request-url';

Signature:

export class RequestUrlError extends Error

Extends: Error

Constructor

new RequestUrlError(params: RequestUrlErrorConstructorParams)

Creates a RequestUrlError.

Properties

PropertyTypeDescription
headersReadonly<Record<string, string>>The response headers.
methodstringThe HTTP method.
statusnumberThe status code.
textstringThe response body as text.
urlstringThe URL.

Methods

MethodReturnsDescription
json()unknownParses the response body as JSON.

Links to this page: