import { QueryFailedError } from 'typeorm' ; export class DBError extends Error { public readonly code : string ; constructor ( message , public readonly queryError ) { super ( message ) ; this . code = ( queryError as unknown as { code : string ; } ) . code ; } }