Skip to content

Commit

Permalink
Print file size if file too large (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
gimenete authored Jul 25, 2023
1 parent b5bce68 commit 1bd07b4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/commands/up.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ pub async fn command(args: Args, _json: bool) -> Result<()> {
return Err(RailwayError::FailedToUpload(body.message).into());
}

if status == 413 {
let filesize = arc.lock().unwrap().len();
return Err(RailwayError::FailedToUpload(format!(
"Failed to upload code. File too large ({} bytes)",
filesize
)))?;
}

return Err(RailwayError::FailedToUpload(format!(
"Failed to upload code with status code {status}"
))
Expand Down

0 comments on commit 1bd07b4

Please sign in to comment.