undici icon indicating copy to clipboard operation
undici copied to clipboard

Provide a more descriptive error on fetching "file" scheme

Open kettanaito opened this issue 4 months ago • 3 comments

This would solve...

The current error is cryptic, to say the least:

https://github.com/nodejs/undici/blob/68107da3fdd6cd0397f4800a2bc9630c802eda58/lib/web/fetch/index.js#L945

The implementation should look like...

makeNetworkError('Failed to fetch the "file" URL scheme: not implemented')

Additional context

There's an existing better error for an unsupported URL schemes, like about:

https://github.com/nodejs/undici/blob/68107da3fdd6cd0397f4800a2bc9630c802eda58/lib/web/fetch/index.js#L786

I'd still like to have it mention "fetch" at least somewhere so it's clear where the issue originates from.

kettanaito avatar Oct 16 '24 10:10 kettanaito