mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
[babel] Remove unused PipelineError
Most of the use cases are already handled with ErrorSeverity.InvalidConfig
This commit is contained in:
1 parent
0beeb1e7ad
commit
4e7d437880
2 files changed
+4
-24
No files matched your search
@@ -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