Skip to content

[Bug]: HttpError from authWellknownEndpointUrl is changed to [object Object] #2142

@MartinLanghammer

Description

@MartinLanghammer

Version

20.0.2

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Angular ErrorHandler got [object Object] message when authWellknownEndpointUrl ends with http error. It is becouse here https://github.com/damienbod/angular-auth-oidc-client/blob/main/projects/angular-auth-oidc-client/src/lib/config/auth-well-known/auth-well-known.service.ts#L52 is throwError(() => new Error(error)); so everytime on error property will be called .toString() and [object Object] is passed to message.

Steps to reproduce the behavior

configure authWellknownEndpointUrl to not existing page. Instead 404 i got [object Object] message in ErrorHandler

A clear and concise description of what you expected to happen.

I expect i can handle HttpError as usual. So at https://github.com/damienbod/angular-auth-oidc-client/blob/main/projects/angular-auth-oidc-client/src/lib/config/auth-well-known/auth-well-known.service.ts#L52 instead throwError(() => new Error(error)); should be something like throwError(error) or throwError(() => error);.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions