various: simplify code; work on security and performance
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9a5114addcab5fbff430ab2b919b83466a6a6964
This commit is contained in:
parent
016841b200
commit
c4adc4e3e0
75 changed files with 12921 additions and 358 deletions
|
|
@ -42,6 +42,12 @@ pub enum PinakesError {
|
|||
|
||||
#[error("invalid operation: {0}")]
|
||||
InvalidOperation(String),
|
||||
|
||||
#[error("authentication error: {0}")]
|
||||
Authentication(String),
|
||||
|
||||
#[error("authorization error: {0}")]
|
||||
Authorization(String),
|
||||
}
|
||||
|
||||
impl From<rusqlite::Error> for PinakesError {
|
||||
|
|
@ -56,4 +62,10 @@ impl From<tokio_postgres::Error> for PinakesError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<serde_json::Error> for PinakesError {
|
||||
fn from(e: serde_json::Error) -> Self {
|
||||
PinakesError::Database(format!("JSON serialization error: {}", e))
|
||||
}
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, PinakesError>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue