oidc-client icon indicating copy to clipboard operation
oidc-client copied to clipboard

Howto catch error without using logger ?

Open Javaman44 opened this issue 4 years ago • 2 comments

Hello Everyone, thank for this good lib...very useful :) I have read almost all the documentation and some source code and i don't find information about error catching. The only way to handle error is passing by ErrorLog:

<AuthenticationProvider configuration={oidcConfiguration} loggerLevel={oidcLog.ERROR} logger={authLogger}>
.....

I want to show network error in the page (through snackbar component). Is possible through logger but it's seems to be not natural way ? Is-it possible for example to catch network error ?

For example if i put wrong url authority server i get this error: 2020-11-05 17_17_29-React App

Thanks :)

Javaman44 avatar Nov 05 '20 16:11 Javaman44

We're getting the same error. Our Authentication Server is only accessible through a VPN, if the user is not connected to the VPN he'll get the Network Error message as well.

RicoRobinson avatar Dec 02 '20 14:12 RicoRobinson

In v4 login function is a promise.

You can also subcrise to all internal events in order to get error. Do you still need this? I will detail it in v4 the readme very soon.

guillaume-chervet avatar Feb 26 '22 20:02 guillaume-chervet