Swap-Aggregator-Subgraph/node_modules/explain-error/example.js
Richa-iitr d211083153 Revert "Revert "added handler""
This reverts commit c36ee8c5ca.
2022-07-03 07:30:05 +05:30

14 lines
326 B
JavaScript

var explain = require('./')
function explainedError(cb) {
require('fs').stat('neoatuhrcoahkrcophkr', function (err) {
if(err) cb(explain(err, 'asked for a file that certainly did not exist'))
else cb()
})
}
explainedError(function (err) {
throw explain(err, 'called an function that was expected to fail')
})