Fix uploader not returning 413 when artifact too large
When an upload exceeds the maximum limit, ErrEntityTooLarge
gets
returned but is wrapped in multiple layers of errors when it is
checked. As a result, when Google Cloud Storage were used to upload
files, artifacts exceeding the maximum size would report a "500 Internal
Server Error" instead of the correct "413 Request Entity Too Large"
error message.
To fix this, we check the state of hardLimitReader
and set the error
to ErrEntityTooLarge
at the end of the SaveFileFromReader
to ensure
that this error will be returned.
Closes #328 (closed)
Edited by Stan Hu