-
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1002 from SeaQL/better-errors
Better error system
- Loading branch information
Showing
20 changed files
with
242 additions
and
163 deletions.
There are no files selected for viewing
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
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
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
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
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,16 +1,16 @@ | ||
use crate::DbErr; | ||
use crate::{DbErr, RuntimeErr}; | ||
|
||
/// Converts an [sqlx::error] execution error to a [DbErr] | ||
pub fn sqlx_error_to_exec_err(err: sqlx::Error) -> DbErr { | ||
DbErr::Exec(err.to_string()) | ||
DbErr::Exec(RuntimeErr::SqlxError(err)) | ||
} | ||
|
||
/// Converts an [sqlx::error] query error to a [DbErr] | ||
pub fn sqlx_error_to_query_err(err: sqlx::Error) -> DbErr { | ||
DbErr::Query(err.to_string()) | ||
DbErr::Query(RuntimeErr::SqlxError(err)) | ||
} | ||
|
||
/// Converts an [sqlx::error] connection error to a [DbErr] | ||
pub fn sqlx_error_to_conn_err(err: sqlx::Error) -> DbErr { | ||
DbErr::Conn(err.to_string()) | ||
DbErr::Conn(RuntimeErr::SqlxError(err)) | ||
} |
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.