This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better error handling in from_row functions
- Loading branch information
1 parent
122d481
commit c3815f2
Showing
12 changed files
with
164 additions
and
64 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "oxidizer-entity-macro" | ||
version = "0.2.0" | ||
version = "0.2.1" | ||
authors = ["Gustavo Sampaio <[email protected]>", "davysson <[email protected]>", "Vandre Leal <[email protected]>"] | ||
edition = "2018" | ||
keywords = ["orm", "tokio-postgres", "refinery", "postgres", "sql"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
[package] | ||
name = "oxidizer-tests" | ||
version = "0.2.0" | ||
version = "0.2.1" | ||
authors = ["Gustavo Sampaio <[email protected]>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
tokio = { version = "0.2", features = ["full"] } | ||
oxidizer = { version = "0.2.0", path = "../oxidizer" } | ||
oxidizer = { version = "0.2.1", path = "../oxidizer" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
|
||
name = "oxidizer" | ||
version = "0.2.0" | ||
version = "0.2.1" | ||
authors = ["Gustavo Sampaio <[email protected]>", "davysson <[email protected]>", "Vandre Leal <[email protected]>"] | ||
edition = "2018" | ||
keywords = ["orm", "tokio-postgres", "refinery", "postgres", "sql"] | ||
|
@@ -23,4 +23,4 @@ barrel = { version = "0.6.5", features = ["pg"] } | |
refinery = { version = "0.3.0", features = ["tokio-postgres"]} | ||
openssl = { version = "0.10", features = ["vendored"] } | ||
|
||
oxidizer-entity-macro = { version = "0.2.0", path = "../oxidizer-entity-macro" } | ||
oxidizer-entity-macro = { version = "0.2.1", path = "../oxidizer-entity-macro" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#[derive(Debug)] | ||
pub enum Error { | ||
PostgresError(tokio_postgres::Error), | ||
OpensslError(openssl::error::ErrorStack), | ||
MobcError(mobc::Error<tokio_postgres::Error>), | ||
RefineryError(refinery::Error), | ||
DoesNotExist, | ||
ReferencedModelIsNotInDB, | ||
Other(String), | ||
} | ||
|
||
pub type DBResult<T> = std::result::Result<T, Error>; | ||
|
||
impl<R> std::convert::From<R> for Error | ||
where | ||
R: std::fmt::Display, | ||
{ | ||
fn from(v: R) -> Self { | ||
Error::Other(v.to_string()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pub mod db; | ||
pub use db::DBResult; | ||
pub use db::Error; | ||
pub use db::DB; | ||
pub mod error; | ||
pub use error::*; | ||
pub mod test_utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.