summaryrefslogtreecommitdiff
path: root/node_modules/luxon/src/impl/invalid.js
blob: 2a2c95b1780a5f5bd439c09de55393ff76f9ae2a (plain)
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;
    }
  }
}