We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a8a135 commit 81121e5Copy full SHA for 81121e5
src/state/error.rs
@@ -30,6 +30,14 @@ impl AppStateError {
30
}
31
inner_errors
32
33
+
34
+ // Format an error for the logs
35
+ pub fn log(&self) {
36
+ log::error!("{self}");
37
+ for error in self.iter_chain().skip(1) {
38
+ log::error!("-> {error}");
39
+ }
40
41
42
43
/// Global error page generated from an [AppStateError].
@@ -51,6 +59,8 @@ pub struct AppStateErrorContextInner {
51
59
52
60
impl From<AppStateError> for AppStateErrorContext {
53
61
fn from(e: AppStateError) -> Self {
62
+ // An error is being displayed to the user, make sure it's also written in the logs
63
+ e.log();
54
64
Self {
55
65
state: AppStateErrorContextInner { errors: vec![e] },
56
66
0 commit comments