import i18n from '~/i18n' ; export enum ErrorType { translating_same_locale = 'errors.translating_same_locale' , translating_unknown_error = 'errors.translating_unknown_error' , translating_empty_source_value = 'errors.translating_empty_source_value' , unsupported_file_type = 'errors.unsupported_file_type' , keystyle_not_set = 'errors.keystyle_not_set' , write_in_readonly_mode = 'errors.write_in_readonly_mode' } export class AllyError extends Error { readonly args : any [ ] = [ ] ; constructor ( public readonly type , public readonly error ? , ... args ) { super ( i18n . t ( type . toString ( ) , ... args ) ) ; this . args = args ; } get stack ( ) { return this . error ?. stack ; } }