penisularhr / src / exceptions / rainfall.ts
rainfall.ts
Raw
import { BadRequestException, NotFoundException } from '@nestjs/common';

export class RainfallNotFoundException extends NotFoundException {
  constructor(error?: string) {
    super('Rainfall not found', error);
  }
}

export class ToTimeEarlierThanFromTimeException extends BadRequestException {
  constructor(error?: string) {
    super('To time should earlier than from time', error);
  }
}

export class RainfallRecordDateExceedTodayException extends BadRequestException {
  constructor(error?: string) {
    super('Record date > today', error);
  }
}

export class RainfallTimeframeExists extends BadRequestException {
  constructor(error?: string) {
    super('Record timeframe between other records', error);
  }
}