Skip to content

Commit e2837b0

Browse files
committed
Log unexpected errors to help with debugging.
1 parent c1ed142 commit e2837b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test-common.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,13 +786,15 @@ async function compareExpectedError(test, err) {
786786
result = getJsonLdErrorCode(err);
787787
assert.ok(err, 'no error present');
788788
assert.strictEqual(result, expect);
789-
} catch(err) {
789+
} catch(_err) {
790790
if(options.bailOnError) {
791791
console.log('\nTEST FAILED\n');
792792
console.log('EXPECTED: ' + expect);
793793
console.log('ACTUAL: ' + result);
794794
}
795-
throw err;
795+
// log the unexpected error to help with debugging
796+
console.log('Unexpected error:', err);
797+
throw _err;
796798
}
797799
}
798800

0 commit comments

Comments
 (0)