Skip to content

Commit

Permalink
Merge PR #165
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Jan 21, 2025
2 parents d3e1229 + 808379b commit 401cadd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Yubico.
* Copyright (C) 2019-2025 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -150,7 +150,8 @@ public <T extends YubiKeyConnection> void requestConnection(
"openConnection("
+ connectionType.getSimpleName()
+ ") exception: "
+ exception.getMessage())));
+ exception.getMessage(),
exception)));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Yubico.
* Copyright (C) 2019-2025 Yubico.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -133,6 +133,15 @@ public <T extends YubiKeyConnection> void requestConnection(
callback.invoke(Result.success(connection));
} catch (IOException e) {
callback.invoke(Result.failure(e));
} catch (Exception exception) {
callback.invoke(
Result.failure(
new IOException(
"openConnection("
+ connectionType.getSimpleName()
+ ") exception: "
+ exception.getMessage(),
exception)));
}
});
}
Expand Down Expand Up @@ -197,6 +206,12 @@ private CachedOtpConnection(Callback<Result<OtpConnection, IOException>> callbac
}
} catch (IOException e) {
callback.invoke(Result.failure(e));
} catch (Exception exception) {
callback.invoke(
Result.failure(
new IOException(
"openConnection(OtpConnection) exception: " + exception.getMessage(),
exception)));
}
});
}
Expand Down

0 comments on commit 401cadd

Please sign in to comment.