File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
emerald-api/src/main/java/io/emeraldpay/impl Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,12 @@ public void setAuth(MetadataHandler auth) {
86
86
this .auth = auth ;
87
87
if (auth .isReady ()) {
88
88
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
+ }
90
95
}
91
96
authQueue .clear ();
92
97
}
Original file line number Diff line number Diff line change @@ -137,10 +137,15 @@ public boolean isReady() {
137
137
@ Override
138
138
public void request (AuthHolder caller ) {
139
139
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 ;
144
149
}
145
150
caller .setAuth (this );
146
151
});
You can’t perform that action at this time.
0 commit comments