You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
568 B
JavaScript
27 lines
568 B
JavaScript
8 years ago
|
'use strict';
|
||
|
|
||
|
const Promise = require("bluebird");
|
||
|
const path = require("path");
|
||
|
const createError = require("create-error");
|
||
|
const reportErrors = require("./");
|
||
|
|
||
|
let TestingError = createError("TestingError", {
|
||
|
someProperty: "foo"
|
||
|
});
|
||
|
|
||
|
let errorReporter = reportErrors(path.join(__dirname, "errors"));
|
||
|
|
||
|
setTimeout(() => {
|
||
|
console.log("bar");
|
||
|
}, 500);
|
||
|
|
||
|
Promise.try(() => {
|
||
|
console.log("foo");
|
||
|
throw new TestingError("Request limit exceeded, API is now on fire", {
|
||
|
qux: {
|
||
|
quz: 1,
|
||
|
quack: [2, false]
|
||
|
}
|
||
|
});
|
||
|
});
|