Fix error handling for large files (and endpoints called as non-json)

This commit is contained in:
Dane Everitt 2020-04-06 21:59:14 -07:00
parent 7f2b477538
commit f9878d842c
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 21 additions and 12 deletions

View file

@ -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();