server/error: Log certain errors on error level

This commit is contained in:
Zhaofeng Li 2023-01-02 18:12:22 -07:00
parent d6c4d883f8
commit b25ae9f777

View file

@ -156,7 +156,10 @@ impl From<super::access::Error> for ServerError {
impl IntoResponse for ServerError {
fn into_response(self) -> Response {
tracing::warn!("{:?}", self);
// TODO: Better logging control
if matches!(self, Self::DatabaseError(_) | Self::RemoteFileError(_) | Self::ManifestSerializationError(_) | Self::AtticError(_)) {
tracing::error!("{:?}", self);
}
// TODO: don't sanitize in dev mode
let sanitized = self.into_clients();