import util from "util" ; import { format } from "./logger" ; export class FatalError extends Error { scope : string ; constructor ( message , scope ) { super ( message ) ; this . scope = scope ; } } export class BatchError extends Error { errors : FatalError [ ] ; constructor ( errors ) { super ( errors . map ( ( x ) => { return format ( x . message , "none" , x . scope ) ; } ) . join ( "\n" ) ) ; this . errors = errors ; } } export class ScopelessError extends Error { } export class UnexpectedBuildError extends FatalError { constructor ( error , pkgName ) { super ( `${ util . format ( "" , error ) . trim ( ) }` , pkgName ) ; } } export class FixableError extends FatalError { }