Improve return type for insert function
This commit is contained in:
@ -1,10 +1 @@
|
||||
use crate::model::*;
|
||||
|
||||
pub type ProtocolResult<T> = Result<T, ProtocolError>;
|
||||
pub enum ProtocolError {
|
||||
BadRequest(String),
|
||||
FileNotFound(String),
|
||||
Conflict(String),
|
||||
InternalServerError(std::io::Error),
|
||||
NotImplemented,
|
||||
}
|
||||
|
@ -109,10 +109,6 @@ where
|
||||
panic!("Contract Violation: handler must not return NeedTextureData \
|
||||
when data is given.");
|
||||
}
|
||||
Ok(ReplaceTextureStatus::Conflict) => {
|
||||
connection
|
||||
.send(&Package::Error(409, "Conflict".to_string()))?;
|
||||
}
|
||||
Err(err) => {
|
||||
connection.send(&Package::from(err))?;
|
||||
}
|
||||
@ -129,9 +125,6 @@ where
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(ReplaceTextureStatus::Conflict) => {
|
||||
connection.send(&Package::Error(409, "Conflict".to_string()))?;
|
||||
}
|
||||
Err(err) => {
|
||||
connection.send(&Package::from(err))?;
|
||||
}
|
||||
|
Reference in New Issue
Block a user