import { Node } from '../parser' ; import { InternetObject } from '../internet-object' ; /**
 * Represents the base error class in InternetObject.
 */ export class InternetObjectError extends Error { public __proto__ : Error ; /**
     * An error-code associated with the current error.
     */ public errorCode ? : string ; /**
     * A line number (in the text) where error has occured.
     * Only available with some errors while parsting text data.
     */ public lineNumber ? : number ; /**
     * Column number (in the text) where error has occured.
     * Only available with some errors while parsting text data.
     */ public columnNumber ? : number ; /**
     * The index (in the text) where error has occured.
     * Only available with some errors while parsting text data.
     */ public index ? : number ; param errorCode { string } param message { string } param node { Node } param ssf { Function } constructor ( errorCode , message = '' , node ? , ssf ? ) { super ( ) ; let errorMsg = errorCode ; this . errorCode = errorCode ; this . name = 'InternetObjectError' ; if ( node ) { this . lineNumber = node . row ; this . columnNumber = node . col ; this . index = node . index ; errorMsg = `${ errorCode } at (${ node . row }, ${ node . col })` ; } else { errorMsg = errorCode ; } this . message = message !== '' ? `${ errorMsg }: ${ message }` : errorMsg ; Error . captureStackTrace ( this , InternetObjectError ) ; this . __proto__ = new . target . prototype ; } } /**
 * Represents the syntax error in InternetObject. When this error is thrwon,
 * it suggests that a syntax in the associated object is is not correct.
 */ export class InternetObjectSyntaxError extends InternetObjectError { param errorCode { string } param message { string } param node { Node } param ssf { Function } internal constructor ( errorCode , message = '' , node ? , ssf ? ) { super ( errorCode , message , node , ssf ) ; this . name = 'InternetObject(SyntaxError)' ; } } /**
 * Represents the validation error in InternetObject. This error is thrown when a validation
 * issue is found while validating the internet-object data against the associated schema.
 */ export class InternetObjectValidationError extends InternetObjectError { param errorCode { string } param message { string } param node { Node } param ssf { Function } internal constructor ( errorCode , message = '' , node ? , ssf ? ) { super ( errorCode , message , node , ssf ) ; this . name = 'InternetObject(ValidationError)' ; } } export type ErrorArgs = [ string , string , Node ? ] ;