mirror of
https://github.com/morluto/rea
synced 2026-10-28 06:46:47 -04:00
fix(javascript): preserve resource error reasons across worker frames
Serialize the typed resource reason once and let the application own path formatting, retaining partial static observations and reported limits. Reviewed-PR: #3039 Co-authored-by: balkan16 <57933796+balkan16@users.noreply.github.com>
This commit is contained in:
@@ -278,7 +278,7 @@ export class JavaScriptAnalysisWorker {
|
||||
error: new AnalysisResourceConstraintError(
|
||||
OPERATION,
|
||||
response.resource ?? "memory",
|
||||
`${file.path}: ${response.message}`,
|
||||
response.message,
|
||||
{ ...this.#limits(), ...response.limits },
|
||||
),
|
||||
});
|
||||
|
||||
@@ -189,7 +189,13 @@ const analyzeJob = async (
|
||||
cause instanceof AnalysisResourceConstraintError
|
||||
? cause.reportedLimits
|
||||
: null,
|
||||
message: cause instanceof Error ? cause.message : String(cause),
|
||||
// The parent owns resource-error formatting; send its canonical reason.
|
||||
message:
|
||||
cause instanceof AnalysisResourceConstraintError
|
||||
? cause.reason
|
||||
: cause instanceof Error
|
||||
? cause.message
|
||||
: String(cause),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user