Fix error handling for large files (and endpoints called as non-json)
This commit is contained in:
parent
7f2b477538
commit
f9878d842c
4 changed files with 21 additions and 12 deletions
|
@ -49,9 +49,7 @@ class DaemonFileRepository extends DaemonRepository
|
|||
$length = (int) $response->getHeader('Content-Length')[0] ?? 0;
|
||||
|
||||
if ($notLargerThan && $length > $notLargerThan) {
|
||||
throw new FileSizeTooLargeException(
|
||||
trans('server.files.exceptions.max_size')
|
||||
);
|
||||
throw new FileSizeTooLargeException;
|
||||
}
|
||||
|
||||
return $response->getBody()->__toString();
|
||||
|
|
Reference in a new issue