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