Skip to content

Conversation

@jefferyto
Copy link
Contributor

What?

Ensure the cause for upload fetch errors (error.cause) is retained so that it gets surfaced/printed at the server console.

Why?

The error message for errors thrown by fetch (e.g. network connectivity issues, SSL certificate errors, etc.) is very generic (basically "fetch failed"); the actual error message/code is in error.cause. The current error handling for upload fetches discards the cause, making it very difficult to debug fetch errors.

How?

This updates FileRetrievalError to accept the error cause as a parameter (passing it as the data parameter of APIError), and updates the try/catch clauses in safeFetch and generateFileData to pass the error cause to FileRetrievalError.

@jefferyto jefferyto force-pushed the feat-retain-cause-for-upload-fetch-errors branch 5 times, most recently from d40904c to ea87fad Compare December 20, 2025 08:59
@jefferyto jefferyto force-pushed the feat-retain-cause-for-upload-fetch-errors branch 3 times, most recently from bb73130 to 5a64417 Compare December 24, 2025 04:37
@jefferyto jefferyto force-pushed the feat-retain-cause-for-upload-fetch-errors branch from 5a64417 to 80e0887 Compare December 24, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant