Skip to content

Commit fb3699b

Browse files
authored
chore: Update error handling ADR - mention non_exhaustive (#2865)
1 parent a711ae9 commit fb3699b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/adr/001_error_handling.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,5 @@ Note that at the time of writing, there is no instance we have identified within
171171
We will use [thiserror](https://docs.rs/thiserror/latest/thiserror/) by default to implement Rust's [error trait](https://doc.rust-lang.org/core/error/trait.Error.html).
172172
This keeps our code clean, and as it does not appear in our interface, we can choose to replace any particular usage with a hand-rolled implementation should we need to.
173173

174+
### 6. Don't use `#[non_exhaustive]` by default
175+
If an `Error` response set is closed - if we can confidently say it is very unlikely to gain new variants in the future - we should not annotate it with `#[non_exhaustive]`. By way of example, the variants of the exporter error types described above are exhaustively documented in the OpenTelemetry Specification, and we can confidently say that we do not expect new variants.

0 commit comments

Comments
 (0)