UNPKG

@ar.io/sdk

Version:

[![codecov](https://codecov.io/gh/ar-io/ar-io-sdk/graph/badge.svg?token=7dXKcT7dJy)](https://codecov.io/gh/ar-io/ar-io-sdk)

65 lines (64 loc) 2.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AbortError = exports.InvalidProcessConfigurationError = exports.InvalidContractConfigurationError = exports.InvalidSignerError = exports.WriteInteractionError = exports.UnknownError = exports.FailedRequestError = exports.BadRequest = exports.NotFound = exports.BaseError = void 0; /** * Copyright (C) 2022-2024 Permanent Data Solutions, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class BaseError extends Error { constructor(message) { super(message); this.name = this.constructor.name; } } exports.BaseError = BaseError; class NotFound extends BaseError { } exports.NotFound = NotFound; class BadRequest extends BaseError { } exports.BadRequest = BadRequest; class FailedRequestError extends BaseError { constructor(status, message) { super(`Failed request: ${status}: ${message}`); } } exports.FailedRequestError = FailedRequestError; class UnknownError extends BaseError { } exports.UnknownError = UnknownError; class WriteInteractionError extends BaseError { } exports.WriteInteractionError = WriteInteractionError; class InvalidSignerError extends BaseError { constructor() { super('Invalid signer. Please provide a valid signer to interact with the contract.'); } } exports.InvalidSignerError = InvalidSignerError; class InvalidContractConfigurationError extends BaseError { constructor() { super('Invalid contract configuration'); } } exports.InvalidContractConfigurationError = InvalidContractConfigurationError; class InvalidProcessConfigurationError extends BaseError { constructor() { super('Invalid process configuration'); } } exports.InvalidProcessConfigurationError = InvalidProcessConfigurationError; class AbortError extends BaseError { } exports.AbortError = AbortError;