in anyhow mode, how does the middleware obtain the anyhow err #82
Replies: 4 comments
-
If you enable anyhow, it just let anyhow::Error implement
What is your specific requirement? |
Beta Was this translation helpful? Give feedback.
-
我需要通过中间件或全局配置在控制台显示错误并且方便收集错误, 当然用tracing到处打点是一个办法 , 内置的LogHandler只显示500, 不显示anyhow返回的具体错误, 开发调试、错误收集都不方便 |
Beta Was this translation helpful? Give feedback.
-
一般项目开发时, 你都需要自定义一个错误类型, 你让那个错误类型实现 Writer, 然后自己想怎么写都行. |
Beta Was this translation helpful? Give feedback.
-
其实 anyhow 的错误其实也是被当成了 500 错误的. 如果想细粒度控制, 建议是自定义错误类型. |
Beta Was this translation helpful? Give feedback.
-
in anyhow mode, how does the middleware obtain the anyhow err
Beta Was this translation helpful? Give feedback.
All reactions