Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
philipperolet committed Sep 1, 2023
1 parent 8004a79 commit 876225a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/bin/dust_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,13 +1212,14 @@ fn error_response(
message: &str,
error: Option<anyhow::Error>,
) -> (StatusCode, Json<APIResponse>) {
utils::error(&format!("{}: {}\nError: {:?}", code, message, error));
(
status,
Json(APIResponse {
error: Some(APIError {
code: code.to_string(),
message: match error {
Some(err) => format!("{}\nError: {}", message, err),
Some(err) => format!("{}\nError: {:?}", message, err),
None => message.to_string(),
},
}),
Expand Down
2 changes: 1 addition & 1 deletion core/src/stores/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::stores::store::{Store, POSTGRES_TABLES, SQL_INDEXES};
use crate::utils;
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use bb8::{Pool, PooledConnection};
use bb8::Pool;
use bb8_postgres::PostgresConnectionManager;
use serde_json::Value;
use std::collections::{HashMap, HashSet};
Expand Down

0 comments on commit 876225a

Please sign in to comment.