Annotate Api::Problem error with thiserror::transparent
Error variant `Api::Problem` prints "API error: {problem}" however the Problem struct has display impl that starts by printing "API error". Together this results in "API error: API error" followed by the details. This fixes that by annotating `Api::Problem` with `thiserror`'s `transparent` attribute which forwards the display impl to the underlying types display impl.
This commit is contained in:
parent
f0a2b4ef36
commit
1a9ce194b7
|
@ -15,7 +15,7 @@ pub enum Error {
|
||||||
/// An JSON problem as returned by the ACME server
|
/// An JSON problem as returned by the ACME server
|
||||||
///
|
///
|
||||||
/// RFC 8555 uses problem documents as described in RFC 7807.
|
/// RFC 8555 uses problem documents as described in RFC 7807.
|
||||||
#[error("API error: {0}")]
|
#[error(transparent)]
|
||||||
Api(#[from] Problem),
|
Api(#[from] Problem),
|
||||||
/// Failed to base64-decode data
|
/// Failed to base64-decode data
|
||||||
#[error("base64 decoding failed: {0}")]
|
#[error("base64 decoding failed: {0}")]
|
||||||
|
|
Loading…
Reference in New Issue