Skip to content

bug(js): axios 403 handler returns undefined instead of explicit resolve/reject #317

Description

@thejoeejoee

Description

In webpack/src/js/axios.ts, the error interceptor handles 403 responses when `config.allow403 = true`, but returns `undefined` instead of an explicit `Promise.resolve()` or `Promise.reject(error)`.

This means callers' `.then()` handlers receive `undefined` as the response value. While this is technically intentional (swallow the 403), it's fragile — any caller that destructures the response (e.g., `const { data } = await axios.get(...)`) will throw a TypeError.

Severity

Low — potential runtime error in callers that expect a response object.

Location

`webpack/src/js/axios.ts` — error interceptor, 403 handling branch

Fix

Return `Promise.resolve(error.response)` to provide the actual response, or `Promise.resolve(undefined)` explicitly to document the intentional swallow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingimpact: lowLow impact — code quality or minor issuejavascriptPull requests that update Javascript code

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions