Skip to content

Commit 1a38c37

Browse files
Fix deparse error messages to match test expectations
- Add 'deparse error:' prefix to error messages in both async and sync deparse functions - Ensures compatibility with existing test suite expectations - All 18 tests now passing successfully Co-Authored-By: Dan Lynch <[email protected]>
1 parent b65965b commit 1a38c37

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

wasm/index.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const deparse = awaitInit(async (parseTree) => {
7777
const protobufData = protobufCache.get(parseTree);
7878

7979
if (!protobufData) {
80-
throw new Error('No protobuf data found for parse tree. Make sure to use the result from parseQuery directly.');
80+
throw new Error('deparse error: No protobuf data found for parse tree. Make sure to use the result from parseQuery directly.');
8181
}
8282

8383
const dataPtr = wasmModule._malloc(protobufData.length);
@@ -196,7 +196,7 @@ function deparseSync(parseTree) {
196196
const protobufData = protobufCache.get(parseTree);
197197

198198
if (!protobufData) {
199-
throw new Error('No protobuf data found for parse tree. Make sure to use the result from parseQuery directly.');
199+
throw new Error('deparse error: No protobuf data found for parse tree. Make sure to use the result from parseQuery directly.');
200200
}
201201

202202
const dataPtr = wasmModule._malloc(protobufData.length);

wasm/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const deparse = awaitInit(async (parseTree) => {
7777
const protobufData = protobufCache.get(parseTree);
7878

7979
if (!protobufData) {
80-
throw new Error('No protobuf data found for parse tree. Make sure to use the result from parseQuery directly.');
80+
throw new Error('deparse error: No protobuf data found for parse tree. Make sure to use the result from parseQuery directly.');
8181
}
8282

8383
const dataPtr = wasmModule._malloc(protobufData.length);

0 commit comments

Comments
 (0)