import { RpcStatus , GenericErrorNames } from '@centsideas/enums' ; export abstract class Exception extends Error { abstract code : RpcStatus ; abstract name : string ; public timestamp = new Date ( ) . toISOString ( ) ; constructor ( public message , public details ? ) { super ( message ) ; } } export class UnexpectedException extends Exception { code = RpcStatus . UNKNOWN ; name = GenericErrorNames . Unexpected ; constructor ( message ? , details ? ) { super ( message || 'Unexpected error occurred!' , details ) ; } } export class InvalidAuthToken extends Exception { code = RpcStatus . INVALID_ARGUMENT ; name = GenericErrorNames . InvalidAuthToken ; constructor ( message , details ? ) { super ( message , details ) ; } }