mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[babel] Remove unused PipelineError
Most of the use cases are already handled with ErrorSeverity.InvalidConfig
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user