export class DetailedError extends Error { constructor ( public message , public details , public source ? ) { super ( message ) ; Object . setPrototypeOf ( this , DetailedError . prototype ) ; Error . captureStackTrace ( this , DetailedError ) ; } } export function isDetailedError ( error ) { return error . details ; }