From 10248a908171b768478bc17919184f51c87d2623 Mon Sep 17 00:00:00 2001 From: Galoretka Date: Thu, 7 Aug 2025 13:39:11 +0300 Subject: [PATCH 1/2] fix: improve error handling in toBigInt function --- packages/proof/src/to-bigint.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/proof/src/to-bigint.ts b/packages/proof/src/to-bigint.ts index 4424e1860..3232ac5b2 100644 --- a/packages/proof/src/to-bigint.ts +++ b/packages/proof/src/to-bigint.ts @@ -15,6 +15,6 @@ export default function toBigInt(value: BigNumberish | Uint8Array | string): big return _toBigInt(encodeBytes32String(value)) } - throw TypeError(error.message) + throw TypeError(error?.message || error.toString()) } } From e9512d00daadaa254ad3b0d806263efaad2ec3a5 Mon Sep 17 00:00:00 2001 From: Galoretka Date: Thu, 7 Aug 2025 15:05:14 +0300 Subject: [PATCH 2/2] Update packages/proof/src/to-bigint.ts Co-authored-by: John Guilding <54913924+JohnGuilding@users.noreply.github.com> --- packages/proof/src/to-bigint.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/proof/src/to-bigint.ts b/packages/proof/src/to-bigint.ts index 3232ac5b2..7febdf78c 100644 --- a/packages/proof/src/to-bigint.ts +++ b/packages/proof/src/to-bigint.ts @@ -15,6 +15,6 @@ export default function toBigInt(value: BigNumberish | Uint8Array | string): big return _toBigInt(encodeBytes32String(value)) } - throw TypeError(error?.message || error.toString()) + throw TypeError(error instanceof Error ? error.message : error.toString()) } }