Build an error carrying its own HTTP status and code.
parseB2Error reaches its internal_error/500 tail only for errors with no code
of their own, so a bare new Error() always reads as a server fault. Build
every deliberate refusal here instead, so the classification is chosen. It
stays an Error, so stack traces and rejects.toThrow() still work.
Build an error carrying its own HTTP status and code.
parseB2Error reaches its internal_error/500 tail only for errors with no code of their own, so a bare
new Error()always reads as a server fault. Build every deliberate refusal here instead, so the classification is chosen. It stays an Error, so stack traces andrejects.toThrow()still work.