This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
require('util').inherits(module.exports, Error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var _ = require('lodash'); | |
var Chance = require('chance'); | |
var Factory = require('rosie').Factory; | |
function getExternalTransaction(chance) { | |
function getAmount() { | |
return chance.floating({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//setup | |
var someError = "oops"; | |
//before | |
if (someError === "oops") { | |
//do something | |
} else if (someError === "ohgodwhy") { | |
//do something else | |
} else if (someError === "stopthemadness") { | |
//and more |
NewerOlder