From 26fc9e768fac930a7d51c509363878599a01bfc6 Mon Sep 17 00:00:00 2001 From: BlakeMScurr Date: Thu, 17 Nov 2022 12:11:45 +1300 Subject: [PATCH] Propagate compile errors I had a compilation error in my circuit, which failed quietly and didn't generate the output wasm in the tmp directory. So I ended up with an error like `Error: ENOENT: no such file or directory, open '/var/folders/d1/p4jvjs_s1jb30fn8hky7hr5c0000gn/T/circom_-34177-Og3xuSwqOMjn/membership_test_js/membership_test.wasm'`, where that directory doesn't even exist because it was cleaned up. (Not 100% sure this will replicate or whether it's the most robust solution). --- wasm/tester.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wasm/tester.js b/wasm/tester.js index 1609503..42fbcf5 100644 --- a/wasm/tester.js +++ b/wasm/tester.js @@ -87,6 +87,9 @@ async function compile (fileName, options) { if (options.verbose) { console.log(b.stdout); } + if (b.stderr != '') { + throw(b.stderr); + } } catch (e) { assert(false, "circom compiler error \n" + e);