{"version":3,"file":"errors.mjs","sources":["../../src/errors.ts"],"sourcesContent":["import { UmiError } from '@metaplex-foundation/umi';\n\nexport class IrysError extends UmiError {\n  readonly name: string = 'IrysError';\n\n  constructor(message: string, cause?: Error) {\n    super(message, 'plugin', 'Irys', cause);\n  }\n}\n\nexport class FailedToInitializeIrysError extends IrysError {\n  readonly name: string = 'FailedToInitializeIrysError';\n\n  constructor(cause: Error) {\n    const message =\n      'Irys could not be initialized. ' +\n      'Please check the underlying error below for more details.';\n    super(message, cause);\n  }\n}\n\nexport class FailedToConnectToIrysAddressError extends IrysError {\n  readonly name: string = 'FailedToConnectToIrysAddressError';\n\n  constructor(address: string, cause: Error) {\n    const message =\n      `Irys could not connect to the provided address [${address}]. ` +\n      'Please ensure the provided address is valid. Some valid addresses include: ' +\n      '\"https://uploader.irys.xyz\" for mainnet and \"https://devnet.irys.xyz\" for devnet';\n    super(message, cause);\n  }\n}\n\nexport class AssetUploadFailedError extends IrysError {\n  readonly name: string = 'AssetUploadFailedError';\n\n  constructor(status: number) {\n    const message =\n      `The asset could not be uploaded to the Irys network and ` +\n      `returned the following status code [${status}].`;\n    super(message);\n  }\n}\n\nexport class IrysWithdrawError extends IrysError {\n  readonly name: string = 'IrysWithdrawError';\n\n  constructor(error: string) {\n    const message =\n      `The balance could not be withdrawn from the Irys network and ` +\n      `returned the following error: ${error}.`;\n    super(message);\n  }\n}\n\nexport class IrysAbortError extends IrysError {\n  readonly name: string = 'IrysAbortError';\n\n  constructor() {\n    super('The upload was aborted');\n  }\n}\n"],"names":["IrysError","UmiError","name","constructor","message","cause","FailedToInitializeIrysError","FailedToConnectToIrysAddressError","address","AssetUploadFailedError","status","IrysWithdrawError","error","IrysAbortError"],"mappings":";;AAEO,MAAMA,SAAS,SAASC,QAAQ,CAAC;AAC7BC,EAAAA,IAAI,GAAW,WAAW,CAAA;AAEnCC,EAAAA,WAAW,CAACC,OAAe,EAAEC,KAAa,EAAE;IAC1C,KAAK,CAACD,OAAO,EAAE,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