summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2024-04-10 00:16:55 +0200
committerFxQnLr <[email protected]>2024-04-10 00:16:55 +0200
commit3428a637ce420baef9aa9f9803e71bd587867005 (patch)
treea1ad8234ae9bf3709794324a41e38c2f7fa58d0d /src/error.rs
parent907e5cb5bc48899b444f7fedd85af7b5974d9a2e (diff)
downloadwebol-3428a637ce420baef9aa9f9803e71bd587867005.tar
webol-3428a637ce420baef9aa9f9803e71bd587867005.tar.gz
webol-3428a637ce420baef9aa9f9803e71bd587867005.zip
Closes #24. Changed postgres to json directory storage
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/error.rs b/src/error.rs
index 006fcdb..8a011bf 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -11,10 +11,10 @@ use tracing::error;
11 11
12#[derive(Debug, thiserror::Error, ToSchema)] 12#[derive(Debug, thiserror::Error, ToSchema)]
13pub enum Error { 13pub enum Error {
14 #[error("db: {source}")] 14 #[error("json: {source}")]
15 Db { 15 Json {
16 #[from] 16 #[from]
17 source: sqlx::Error, 17 source: serde_json::Error,
18 }, 18 },
19 19
20 #[error("buffer parse: {source}")] 20 #[error("buffer parse: {source}")]
@@ -52,7 +52,7 @@ impl IntoResponse for Error {
52 fn into_response(self) -> Response { 52 fn into_response(self) -> Response {
53 error!("{}", self.to_string()); 53 error!("{}", self.to_string());
54 let (status, error_message) = match self { 54 let (status, error_message) = match self {
55 Self::Db { source } => { 55 Self::Json { source } => {
56 error!("{source}"); 56 error!("{source}");
57 (StatusCode::INTERNAL_SERVER_ERROR, "Server Error") 57 (StatusCode::INTERNAL_SERVER_ERROR, "Server Error")
58 } 58 }