UNPKG

@iexec/iexec-oracle-factory-wrapper

Version:
24 lines 908 B
import { ApiCallError } from 'iexec/errors'; import { ValidationError } from 'yup'; export const updateErrorMessage = 'Failed to update oracle'; 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, observer) { if (error instanceof ApiCallError) { observer.error(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, })); } } export class NoValueError extends Error { } export { ValidationError }; //# sourceMappingURL=errors.js.map