diff --git a/packages/utils/src/ErrorContext.test.ts b/packages/utils/src/ErrorContext.test.ts index db061c026e..e2defd2abe 100644 --- a/packages/utils/src/ErrorContext.test.ts +++ b/packages/utils/src/ErrorContext.test.ts @@ -101,6 +101,13 @@ describe("explainTezError", () => { expect(res).toBe("The delegate is unchanged. Delegation to this address is already done."); }); + it("catches contract.manager.unregistered_delegate", () => { + const res = explainTezError("contract.manager.unregistered_delegate"); + expect(res).toBe( + "The provided delegate address is not registered as a delegate. Verify the delegate address and ensure it is active." + ); + }); + it("returns undefined for unknown errors", () => { const err = "unknown error"; expect(explainTezError(err)).toBeUndefined(); diff --git a/packages/utils/src/ErrorContext.ts b/packages/utils/src/ErrorContext.ts index 13d074d4df..364aecbe25 100644 --- a/packages/utils/src/ErrorContext.ts +++ b/packages/utils/src/ErrorContext.ts @@ -75,6 +75,8 @@ export const explainTezError = (err: string): string | undefined => { return "Emptying an implicit delegated account is not allowed. End delegation before trying again."; } else if (err.includes("delegate.unchanged")) { return "The delegate is unchanged. Delegation to this address is already done."; + } else if (err.includes("contract.manager.unregistered_delegate")) { + return "The provided delegate address is not registered as a delegate. Verify the delegate address and ensure it is active."; } else if (err.includes("michelson_v1.script_rejected")) { return "The contract code failed to run. Please check the contract."; }