Skip to content

Commit

Permalink
Don't panic when file size exceed the limit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWaWaR committed Jan 14, 2024
1 parent caecbde commit 0806b00
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,10 @@ impl MainHandler {
}
Ok(())
}
SaveResult::Partial(_entries, reason) => {
Err((status::InternalServerError, reason.unwrap_err().to_string()))
}
SaveResult::Partial(_entries, reason) => Err((
status::InternalServerError,
format!("save file failed: {:?}", reason),
)),
SaveResult::Error(error) => {
Err((status::InternalServerError, error.to_string()))
}
Expand Down Expand Up @@ -942,7 +943,7 @@ impl MainHandler {

match range {
Some(Range::Bytes(ranges)) => {
if let Some(range) = ranges.get(0) {
if let Some(range) = ranges.first() {
let (offset, length) = match *range {
ByteRangeSpec::FromTo(x, mut y) => {
// "x-y"
Expand Down

0 comments on commit 0806b00

Please sign in to comment.