Skip to content

Commit 7c457e4

Browse files
authored
widen info state hashing catch (#11192)
# What Does This Do Fixes this kind of case happening when using bouncycastle: ``` Error : Error parsing trace agent /info response org.bouncycastle.crypto.fips.FipsOperationError ... ``` The problem is that FipsOperationError extends directly Error hence Throwable and we do not import this class. However, we can widen to throwable here since it's only limited to the hash of the state # Motivation # Additional Notes # Contributor Checklist - Format the title according to [the contribution guidelines](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#title-format) - Assign the `type:` and (`comp:` or `inst:`) labels in addition to [any other useful labels](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#labels) - Avoid using `close`, `fix`, or [any linking keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) when referencing an issue Use `solves` instead, and assign the PR [milestone](https://github.com/DataDog/dd-trace-java/milestones) to the issue - Update the [CODEOWNERS](https://github.com/DataDog/dd-trace-java/blob/master/.github/CODEOWNERS) file on source file addition, migration, or deletion - Update [public documentation](https://docs.datadoghq.com/tracing/trace_collection/library_config/java/) with any new configuration flags or behaviors Jira ticket: [PROJ-IDENT] ***Note:*** **Once your PR is ready to merge, add it to the merge queue by commenting `/merge`.** `/merge -c` cancels the queue request. `/merge -f --reason "reason"` skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see [this doc](https://datadoghq.atlassian.net/wiki/spaces/DEVX/pages/3121612126/MergeQueue). <!-- # Opening vs Drafting a PR: When opening a pull request, please open it as a draft to not auto assign reviewers before you feel the pull request is in a reviewable state. # Linking a JIRA ticket: Please link your JIRA ticket by adding its identifier between brackets (ex [PROJ-IDENT]) in the PR description, not the title. This requirement only applies to Datadog employees. --> Co-authored-by: andrea.marziali <andrea.marziali@datadoghq.com>
1 parent 90af2ba commit 7c457e4

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import datadog.trace.api.telemetry.LogCollector;
2323
import datadog.trace.util.Strings;
2424
import java.nio.ByteBuffer;
25-
import java.security.NoSuchAlgorithmException;
2625
import java.util.HashSet;
2726
import java.util.List;
2827
import java.util.Map;
@@ -311,7 +310,7 @@ private boolean processInfoResponse(State newState, String response) {
311310
}
312311
try {
313312
newState.state = Strings.sha256(response);
314-
} catch (NoSuchAlgorithmException ex) {
313+
} catch (Throwable ex) {
315314
log.debug(
316315
"Failed to hash trace agent /info response. Will probe {}", newState.traceEndpoint, ex);
317316
}

0 commit comments

Comments
 (0)