import { DeserializerError , DeserializerReason } from 'binarytf/dist/lib/errors/DeserializerError' ; since extends Error export class MessageError extends Error { since public kind : DeserializerReason ; since param prefix param error public constructor ( prefix , error ) { super ( `${ prefix }: ${ error . message } [${ error . kind }]` ) ; this . kind = error . kind ; } } since param prefix param error internal private export function makeError ( prefix , error ) { if ( error instanceof DeserializerError ) return new MessageError ( prefix , error ) ; return new Error ( `${ prefix }: ${ error . message }` ) ; }