mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
rename variant
This commit is contained in:
1 parent
3792cf82f2
commit
b68d24040f
3 files changed
+5
-5
No files matched your search
+1
-1
@@ -206,7 +206,7 @@ impl From<crate::http_server::session::session_checker_error::SessionCheckerErro
|
||||
use crate::http_server::session::session_checker_error::SessionCheckerError;
|
||||
match value {
|
||||
// Bad / forged session cookie → 401 (don't page on this)
|
||||
SessionCheckerError::Session(_) => Self::NotAuthorized,
|
||||
SessionCheckerError::SessionPayload(_) => Self::NotAuthorized,
|
||||
// Underlying DB / cache errors → 500 with paging
|
||||
SessionCheckerError::Sqlx(err) => Self::from_error(err),
|
||||
SessionCheckerError::OtherError(err) => Self::from_anyhow_error(err),
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ impl From<crate::http_server::session::session_checker_error::SessionCheckerErro
|
||||
use crate::http_server::session::session_checker_error::SessionCheckerError;
|
||||
match value {
|
||||
// Bad / forged session cookie → 401
|
||||
SessionCheckerError::Session(_) => Self::NotAuthorized,
|
||||
SessionCheckerError::SessionPayload(_) => Self::NotAuthorized,
|
||||
// Underlying DB / cache errors → 500
|
||||
SessionCheckerError::Sqlx(err) => {
|
||||
error!("SessionChecker sqlx error: {:?}", err);
|
||||
|
||||
@@ -9,7 +9,7 @@ pub enum SessionCheckerError {
|
||||
/// Rate of failures can point to the cause:
|
||||
/// - One-off errors: probably session forgeries
|
||||
/// - Lots of errors: maybe the wrong hmac secret
|
||||
Session(HttpUserSessionPayloadError),
|
||||
SessionPayload(HttpUserSessionPayloadError),
|
||||
|
||||
/// Error looking up the session from the database.
|
||||
Sqlx(sqlx::Error),
|
||||
@@ -21,7 +21,7 @@ pub enum SessionCheckerError {
|
||||
impl Display for SessionCheckerError {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Session(e) => write!(f, "session error: {}", e),
|
||||
Self::SessionPayload(e) => write!(f, "session payload error: {}", e),
|
||||
Self::Sqlx(e) => write!(f, "sqlx error: {}", e),
|
||||
Self::OtherError(e) => write!(f, "other error: {}", e),
|
||||
}
|
||||
@@ -32,7 +32,7 @@ impl Error for SessionCheckerError {}
|
||||
|
||||
impl From<HttpUserSessionPayloadError> for SessionCheckerError {
|
||||
fn from(err: HttpUserSessionPayloadError) -> Self {
|
||||
Self::Session(err)
|
||||
Self::SessionPayload(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user