Skip to content

Commit 7c01f98

Browse files
committed
Include function parameters in error messages
For debugging purposes, it's important that error messages include as much relevant information as possible. It's much easier to help a user if they can pass on an accurate error message that they received. But precisely because the messages should be in a form where the user can share it without worrying about leaking secrets (and because such errors may end up in logs that could leak), the messages must not include any confidential data. They should also not be unnecessarily verbose. To implement this, we add the "debug" serialization of the functions' input values to the error message that's returned if the call fails. We use the 'derivative' crate to "redact" fields containing secret or verbose data (i.e. they render as "...").
1 parent e3d6856 commit 7c01f98

File tree

4 files changed

+306
-32
lines changed

4 files changed

+306
-32
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2021"
77
crate-type = ["staticlib", "lib"]
88

99
[dependencies]
10+
derivative = "2.2.0"
1011
thiserror = "1"
1112
uniffi = { version = "0.26", features = ["cli"] }
1213
serde = "1.0"

0 commit comments

Comments
 (0)