Skip to content

Commit 749454d

Browse files
scottgerringTommyCppcijothomas
authored
Apply suggestions from code review
Co-authored-by: Zhongyang Wu <[email protected]> Co-authored-by: Cijo Thomas <[email protected]>
1 parent fc86870 commit 749454d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/adr/001_error_handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Summary
66

7-
This ADR describes the general pattern we will follow when modelling errors in public API interfaces - that is, APIs that are exposed to users of the project's published crates. . It summarises the discussion and final option from [#2571](https://github.com/open-telemetry/opentelemetry-rust/issues/2571); for more context check out that issue.
7+
This ADR describes the general pattern we will follow when modelling errors in public API interfaces - that is, APIs that are exposed to users of the project's published crates. It summarises the discussion and final option from [#2571](https://github.com/open-telemetry/opentelemetry-rust/issues/2571); for more context check out that issue.
88

99
We will focus on the exporter traits in this example, but the outcome should be applied to _all_ public traits and their fallible operations.
1010

@@ -83,7 +83,7 @@ we would let that error traits diverge at that point.
8383

8484
### 4. Box custom errors where a savvy caller may be able to handle them, stringify them if not
8585

86-
Note above that we do not box anything into `InternalFailure`. Our rule here is that if the caller cannot reasonably be expected to handle a particular error variant, we will use a simplified interface that returns only a descriptive string. In the concrete example we are using with the exporters, we have a [strong signal in the opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#export) that indicates that the error types _are not actionable_ by the caller.
86+
Note above that we do not box any `Error` into `InternalFailure`. Our rule here is that if the caller cannot reasonably be expected to handle a particular error variant, we will use a simplified interface that returns only a descriptive string. In the concrete example we are using with the exporters, we have a [strong signal in the opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#export) that indicates that the error types _are not actionable_ by the caller.
8787

8888
If the caller may potentially recover from an error, we will follow the generally-accepted best practice (e.g., see [canonical's guide](https://canonical.github.io/rust-best-practices/error-and-panic-discipline.html) and instead preserve the nested error:
8989

0 commit comments

Comments
 (0)