fix: error when upload failed before all bytes received
ci/woodpecker/pr/build Pipeline is pending
Details
ci/woodpecker/pr/docker Pipeline is pending
Details
ci/woodpecker/pr/docs Pipeline is pending
Details
ci/woodpecker/pr/lint Pipeline is pending
Details
ci/woodpecker/pr/man Pipeline is pending
Details
ci/woodpecker/pr/test Pipeline is pending
Details
ci/woodpecker/pr/build Pipeline is pending
Details
ci/woodpecker/pr/docker Pipeline is pending
Details
ci/woodpecker/pr/docs Pipeline is pending
Details
ci/woodpecker/pr/lint Pipeline is pending
Details
ci/woodpecker/pr/man Pipeline is pending
Details
ci/woodpecker/pr/test Pipeline is pending
Details
parent
3b24ad0f2c
commit
b890684da3
|
@ -68,7 +68,7 @@ fn (mut app App) put_package(repo_ string) web.Result {
|
|||
mut sw := time.new_stopwatch(time.StopWatchOptions{ auto_start: true })
|
||||
|
||||
util.reader_to_file(mut app.reader, length.int(), pkg_path) or {
|
||||
app.lwarn("Failed to upload '${pkg_path}'")
|
||||
app.lwarn("Failed to upload '${pkg_path}': ${err.msg()}")
|
||||
|
||||
return app.status(.internal_server_error)
|
||||
}
|
||||
|
|
|
@ -46,6 +46,10 @@ pub fn reader_to_file(mut reader io.BufferedReader, length int, path string) ! {
|
|||
to_write = to_write - bytes_written
|
||||
}
|
||||
}
|
||||
|
||||
if bytes_left > 0 {
|
||||
return error('Not all bytes were received.')
|
||||
}
|
||||
}
|
||||
|
||||
// match_array_in_array[T] returns how many elements of a2 overlap with a1. For
|
||||
|
|
Loading…
Reference in New Issue