aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/errors.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-10 21:39:25 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-10 21:39:25 -0800
commit9a83067d04c9648416b92fc8d7b8a542b0b9aa96 (patch)
tree4622455b0f694262db5aa77314a3941ab37419fc /rust/src/errors.rs
parentb75aa46db21c6f7a22b6fbbbd00b1e5d93e1d1ae (diff)
downloadfatcat-9a83067d04c9648416b92fc8d7b8a542b0b9aa96.tar.gz
fatcat-9a83067d04c9648416b92fc8d7b8a542b0b9aa96.zip
code docs/comments and rustfmt
Diffstat (limited to 'rust/src/errors.rs')
-rw-r--r--rust/src/errors.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/rust/src/errors.rs b/rust/src/errors.rs
index 19ba2f82..ec2b949b 100644
--- a/rust/src/errors.rs
+++ b/rust/src/errors.rs
@@ -116,9 +116,13 @@ impl Into<models::ErrorResponse> for FatcatError {
impl From<diesel::result::Error> for FatcatError {
fn from(inner: diesel::result::Error) -> FatcatError {
match inner {
- diesel::result::Error::NotFound => FatcatError::NotFound("unknown".to_string(), "N/A".to_string()),
- diesel::result::Error::DatabaseError(_, _) => FatcatError::ConstraintViolation(inner.to_string()),
- _ => FatcatError::InternalError(inner.to_string())
+ diesel::result::Error::NotFound => {
+ FatcatError::NotFound("unknown".to_string(), "N/A".to_string())
+ }
+ diesel::result::Error::DatabaseError(_, _) => {
+ FatcatError::ConstraintViolation(inner.to_string())
+ }
+ _ => FatcatError::InternalError(inner.to_string()),
}
}
}
@@ -178,4 +182,3 @@ impl From<failure::Error> for FatcatError {
FatcatError::InternalError(error.to_string())
}
}
-