1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const StormError_1 = require("./StormError");
|
4 | const ErrorCode_1 = require("./ErrorCode");
|
5 | const StatusCode_1 = require("./StatusCode");
|
6 | class InvalidValueError extends StormError_1.StormError {
|
7 | constructor(variable, expected, got) {
|
8 | super({
|
9 | variable: variable,
|
10 | expected: expected,
|
11 | got: got
|
12 | });
|
13 | }
|
14 | getMessage() {
|
15 | let details = this.getPrivateDetails();
|
16 | return `Unexpected value for "${details.variable}". Expected ${details.expected} but got "${details.got}".`;
|
17 | }
|
18 | getCode() {
|
19 | return ErrorCode_1.ErrorCode.INVALID_VALUE;
|
20 | }
|
21 | getHTTPCode() {
|
22 | return StatusCode_1.StatusCode.ERR_BAD_REQUEST;
|
23 | }
|
24 | }
|
25 | exports.InvalidValueError = InvalidValueError;
|
26 |
|
\ | No newline at end of file |