[babel] Remove unused PipelineError

Most of the use cases are already handled with ErrorSeverity.InvalidConfig
This commit is contained in:
Sathya Gunasekaran
2023-11-08 16:09:18 +00:00
parent 0beeb1e7ad
commit 4e7d437880
2 changed files with 4 additions and 24 deletions
@@ -138,11 +138,6 @@ export type LoggerEvent =
fnLoc: t.SourceLocation | null;
fnName: string | null;
memoSlots: number;
}
| {
kind: "PipelineError";
fnLoc: t.SourceLocation | null;
data: any;
};
export type Logger = {
@@ -68,29 +68,14 @@ type CompileResult = {
function handleError(
pass: CompilerPass,
fnLoc: t.SourceLocation | null,
err: unknown
err: CompilerError
): void {
if (pass.opts.logger) {
if (err instanceof CompilerError) {
for (const detail of err.details) {
pass.opts.logger.logEvent(pass.filename, {
kind: "CompileError",
fnLoc,
detail: detail.options,
});
}
} else {
let stringifiedError;
if (err instanceof Error) {
stringifiedError = err.stack ?? err.message;
} else {
stringifiedError = err?.toString() ?? "[ null ]";
}
for (const detail of err.details) {
pass.opts.logger.logEvent(pass.filename, {
kind: "PipelineError",
kind: "CompileError",
fnLoc,
data: stringifiedError,
detail: detail.options,
});
}
}