@iexec/web3mail
Version:
This product enables users to confidentially store data–such as mail address, documents, personal information ...
19 lines • 716 B
JavaScript
import { ApiCallError } from 'iexec/errors';
export class WorkflowError extends Error {
isProtocolError;
constructor({ message, errorCause, isProtocolError = false, }) {
super(message, { cause: errorCause });
this.name = this.constructor.name;
this.isProtocolError = isProtocolError;
}
}
export function handleIfProtocolError(error) {
if (error instanceof ApiCallError) {
throw new WorkflowError({
message: "A service in the iExec protocol appears to be unavailable. You can retry later or contact iExec's technical support for help.",
errorCause: error,
isProtocolError: true,
});
}
}
//# sourceMappingURL=errors.js.map