mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-14 00:07:00 +01:00
fix: preserve streamer error semantics for cache probes
This commit is contained in:
1 parent
07458f536a
commit
0abbe34aed
2 files changed
+36
No files matched your search
@@ -484,6 +484,15 @@ export default class AnonymizedFile {
|
||||
res.once("close", cancel);
|
||||
if (res.destroyed || res.writableEnded) cancel();
|
||||
try { return await probeStreamerCache(url, payload, headers, cancellation.signal); }
|
||||
catch (err) {
|
||||
headersDone(true);
|
||||
const { error } = streamerErrorToAnonymous(err as Error & {
|
||||
response?: { statusCode?: number; body?: unknown };
|
||||
}, { repoId: this.repository.repoId, filePath: this.anonymizedPath });
|
||||
void notifyOwnerAccessProblem(this.repository.owner.id, error, { kind: "repository", id: String(this.repository.model._id) });
|
||||
error.value = this;
|
||||
throw error;
|
||||
}
|
||||
finally { res.removeListener("close", cancel); }
|
||||
};
|
||||
const cached = await probe();
|
||||
|
||||
Reference in new issue
Block a user