refactor(runtime): name all silent catch causes without changing diagnostics (#637)
* refactor(domain): split error taxonomy into thematic modules Move each error family out of domain/errors.ts into its own module (base, core, provider selection/adapter, browser observation, artifact, evidence, unknown registry, hopper, configuration) and relocate AnalysisErrorProjection to analysisErrorProjection. Migrate all 162 importers to the owning modules and delete errors.ts. No re-export shims; behavior is unchanged. * refactor(runtime): name all silent catch causes without changing diagnostics Bind cause in every bare catch and unhandled rejection across src/. Real failures preserve the cause for logging; best-effort cleanup carries an explicit comment. Caller-visible and Evidence strings are byte-identical to before.
This commit is contained in:
@@ -199,7 +199,8 @@ const normalizeSourceMap = (
|
||||
status: "partial",
|
||||
limitation: `Module edges are incomplete: ${modules.incomplete.length} of ${originalSources.filter(({ artifact }) => artifact !== null).length} original sources could not be parsed in full (${modules.incomplete.join(", ")}).`,
|
||||
};
|
||||
} catch {
|
||||
} catch (cause: unknown) {
|
||||
void cause;
|
||||
return emptySourceMapItem(
|
||||
request,
|
||||
"invalid",
|
||||
@@ -311,7 +312,9 @@ const approvedUrl = (
|
||||
parsed.password === "" &&
|
||||
allowedOrigins.includes(parsed.origin)
|
||||
);
|
||||
} catch {
|
||||
} catch (cause: unknown) {
|
||||
// Non-URL input is not an approved source-map URL.
|
||||
void cause;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -338,7 +341,9 @@ const emptySourceMapItem = (
|
||||
const sanitizeSource = (value: string): string => {
|
||||
try {
|
||||
return sanitizeBrowserUrl(new URL(value).href).url;
|
||||
} catch {
|
||||
} catch (cause: unknown) {
|
||||
// Non-URL sources are preserved verbatim.
|
||||
void cause;
|
||||
return value;
|
||||
}
|
||||
};
|
||||
@@ -349,7 +354,9 @@ const resolveOriginalSource = (
|
||||
): string | null => {
|
||||
try {
|
||||
return sanitizeSource(new URL(specifier, base).href);
|
||||
} catch {
|
||||
} catch (cause: unknown) {
|
||||
// Unresolvable source specifiers are represented by null.
|
||||
void cause;
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user