license import { ParseErrorLevel , ParseSourceSpan } from '@angular/compiler' ; /**
 * This error is thrown when there is a problem parsing a translation file.
 */ export class TranslationParseError extends Error { constructor ( public span , public msg , public level = ParseErrorLevel . ERROR ) { super ( msg ) ; } contextualMessage ( ) { const ctx = this . span . start . getContext ( 100 , 3 ) ; return ctx ? `${ this . msg } ("${ ctx . before }[${ ParseErrorLevel [ this . level ] } ->]${ ctx . after }")` : this . msg ; } toString ( ) { const details = this . span . details ? `, ${ this . span . details }` : '' ; return `${ this . contextualMessage ( ) }: ${ this . span . start }${ details }` ; } }