import { $Values } from 'utility-types' ; public export const ErrorType = Object . freeze ( { Graceful : 'graceful' as const , } ) ; public export type ErrorType = $Values < typeof ErrorType > ; internal export class GracefulError extends Error { type = ErrorType . Graceful ; } internal export function isGracefulError ( error ) { return ( error as GracefulError ) ?. type === ErrorType . Graceful ; }