invalid.js 282 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 export default class Invalid { constructor(reason, explanation) { this.reason = reason; this.explanation = explanation; } toMessage() { if (this.explanation) { return `${this.reason}: ${this.explanation}`; } else { return this.reason; } } }