Check if an error indicates a 401 Unauthorized response
This helper centralizes the fragile logic of detecting 401 errors from
various sources (HTTP status codes, error messages, wrapped errors).
Used during endpoint discovery to detect authentication requirements.
Parameters
error: unknown
The error to check
got401Flag: boolean = false
Optional flag that was set by tracking HTTP responses
Returns boolean
true if the error appears to be a 401 authentication error
Check if an error indicates a 401 Unauthorized response
This helper centralizes the fragile logic of detecting 401 errors from various sources (HTTP status codes, error messages, wrapped errors). Used during endpoint discovery to detect authentication requirements.