bluecodex
Version:
Turn repetitive dev tasks into CLI commands with Typescript
20 lines (16 loc) • 435 B
text/typescript
import type { ValidArg } from "../../arg/arg";
import type { ValidFlag } from "../../flag/flag";
export class ParseArgvNumberCannotFloatError extends Error {
constructor(
readonly field: ValidArg | ValidFlag,
readonly value: number,
) {
super();
}
get message() {
return `${this.field.__objectType__} expects an integer, ${this.value} given`;
}
get reason() {
return "does not allow decimals";
}
}