import { Unit } from '@elastic/datemath' ; import { i18n } from '@osd/i18n' ; export class InvalidOpenSearchCalendarIntervalError extends Error { constructor ( public readonly interval , public readonly value , public readonly unit , public readonly type ) { super ( i18n . translate ( 'data.parseOpenSearchInterval.invalidOpenSearchCalendarIntervalErrorMessage' , { defaultMessage : 'Invalid calendar interval: {interval}, value must be 1' , values : { interval } , } ) ) ; this . name = 'InvalidOpenSearchCalendarIntervalError' ; this . value = value ; this . unit = unit ; this . type = type ; if ( Error . captureStackTrace ) { Error . captureStackTrace ( this , InvalidOpenSearchCalendarIntervalError ) ; } Object . setPrototypeOf ( this , InvalidOpenSearchCalendarIntervalError . prototype ) ; } }