nodejs/test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js

12 lines
281 B
JavaScript
Raw Normal View History

'use strict';
require('../common');
const { AsyncResource } = require('async_hooks');
try {
new AsyncResource('foo').runInAsyncScope(() => { throw new Error('bar'); });
} catch {
// Continue regardless of error.
}
// Should abort (fail the case) if async id is not matching.