aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/lib.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-15 23:05:07 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-15 23:05:07 -0700
commit8517c76b92d5fa7041c330438e33f2b08924ac7b (patch)
tree1d2b76814b9b18218d75df67a98c5149b5dd3384 /rust/src/lib.rs
parent386928f9c5860afca72b4ae00c4d5e28efc50bef (diff)
downloadfatcat-8517c76b92d5fa7041c330438e33f2b08924ac7b.tar.gz
fatcat-8517c76b92d5fa7041c330438e33f2b08924ac7b.zip
refactor error handling
Diffstat (limited to 'rust/src/lib.rs')
-rw-r--r--rust/src/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index b59d6024..8069ad0b 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -20,9 +20,19 @@ pub mod database_models;
pub mod database_schema;
mod errors {
- error_chain!{}
+ // Create the Error, ErrorKind, ResultExt, and Result types
+ error_chain! {
+ foreign_links { Fmt(::std::fmt::Error);
+ Diesel(::diesel::result::Error);
+ Uuid(::uuid::ParseError);
+ Io(::std::io::Error) #[cfg(unix)];
+ }
+ }
}
+#[doc(hidden)]
+pub use errors::*;
+
pub use self::errors::*;
use diesel::pg::PgConnection;
use diesel::prelude::*;