postchain-client
Version:
Client library for accessing a Postchain node through REST.
38 lines • 1.43 kB
JavaScript
import { CustomError } from "../customError";
export class MissingPubKeyError extends CustomError {
constructor() {
super(`No public key was provided`, 400);
}
}
export class MissingBlockchainIdentifierError extends CustomError {
constructor() {
super(`No blockchain identifier was provided. Include either a blockchainRid (string) or a blockchainIid (number).`, 400);
}
}
export class MissingNodeUrlError extends CustomError {
constructor() {
super(`No node url or directory node url was provided. Include either a nodeUrl (string or string[]) or a directory node url (string or string[]).`, 400);
}
}
export class BlockchainUrlUndefinedException extends CustomError {
constructor(brid) {
const idType = typeof brid === "string" ? "BRID" : "IID";
super(`Cannot find nodes hosting the blockchain with ${idType} ${brid}`, 400);
}
}
export class DirectoryNodeUrlPoolException extends CustomError {
constructor() {
super(`No directory node url was provided`, 400);
}
}
export class InvalidTransactionFormatException extends CustomError {
constructor() {
super(`The transaction is not in the right format`, 400);
}
}
export class GetTransactionRidException extends CustomError {
constructor(error) {
super(`"Error occurred while getting transaction RID:", ${error}`, 400);
}
}
//# sourceMappingURL=errors.js.map