import { ErrorCode } from './internal' ; const ERROR_PREFIX = 'Error: ' ; export default class XDLError extends Error { readonly name = 'XDLError' ; code : string ; isXDLError : true ; constructor ( code , message ) { super ( '' ) ; if ( message . startsWith ( ERROR_PREFIX ) ) { message = message . substring ( ERROR_PREFIX . length ) ; } this . message = message ; this . code = code ; this . isXDLError = true ; } }