File tree Expand file tree Collapse file tree
emerald-api/src/main/java/io/emeraldpay/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,7 +86,12 @@ public void setAuth(MetadataHandler auth) {
8686 this .auth = auth ;
8787 if (auth .isReady ()) {
8888 for (Consumer <MetadataHandler > listener : authQueue ) {
89- listener .accept (auth );
89+ try {
90+ listener .accept (auth );
91+ } catch (Exception e ) {
92+ System .err .println ("Error in auth listener: " + e .getMessage ());
93+ // ignore any exceptions in the listener, it should not block the auth update
94+ }
9095 }
9196 authQueue .clear ();
9297 }
Original file line number Diff line number Diff line change @@ -137,10 +137,15 @@ public boolean isReady() {
137137 @ Override
138138 public void request (AuthHolder caller ) {
139139 executor .submit (() -> {
140- if (jwt == null ) {
141- authSync ();
142- } else {
143- refreshSync ();
140+ try {
141+ if (jwt == null ) {
142+ authSync ();
143+ } else {
144+ refreshSync ();
145+ }
146+ } catch (Exception e ) {
147+ System .err .println ("Error during the authentication: " + e .getMessage ());
148+ return ;
144149 }
145150 caller .setAuth (this );
146151 });
You can’t perform that action at this time.
0 commit comments