import chalk from 'chalk' ; import { normalizePath } from '../utils' ; export class ErrorReporter { errors : string [ ] = [ ] ; withContext ( context ) { return { report : ( error ) => this . report ( error , context ) } ; } report ( error , context ) { this . errors . push ( `${ chalk . white . bgRed ( ' TELEMETRY ERROR ' ) } Error in ${ normalizePath ( context . name ) }\n${ error }` ) ; } }