Skip to content

Latest commit

History

History
36 lines (29 loc) 路 825 Bytes

QUnit.onUncaughtException.md

File metadata and controls

36 lines (29 loc) 路 825 Bytes
layout title excerpt groups version_added redirect_from
page-api
QUnit.onUncaughtException()
Handle a global error.
extension
2.17.0
/config/QUnit.onUncaughtException/
/extension/QUnit.onUncaughtException/

QUnit.onUncaughtException( error )

Handle a global error that should result in a failed test run.

name description
error (any) Usually an Error object, but any other thrown or rejected value may be given as well.

Examples

const error = new Error('Failed to reverse the polarity of the neutron flow');
QUnit.onUncaughtException(error);
process.on('uncaughtException', QUnit.onUncaughtException);
window.addEventListener('unhandledrejection', function (event) {
  QUnit.onUncaughtException(event.reason);
});