mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-26 15:25:18 +02:00
Simplified file hashing error message code a bit
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
await axios.get('?info=' + filePath).then(function (response) {
|
||||
this.hashes = response.data.hashes;
|
||||
}.bind(this)).catch(function (error) {
|
||||
this.error = error.response.data.message;
|
||||
this.error = error.response.request.statusText;
|
||||
}.bind(this));
|
||||
|
||||
this.loading = false;
|
||||
|
@@ -48,18 +48,10 @@ class FileInfoController
|
||||
);
|
||||
|
||||
if (! $file->isFile()) {
|
||||
$response->getBody()->write(json_encode([
|
||||
'message' => $this->translator->trans('error.file_not_found'),
|
||||
]));
|
||||
|
||||
return $response->withStatus(404, $this->translator->trans('error.file_not_found'));
|
||||
}
|
||||
|
||||
if ($file->getSize() >= $this->container->get('max_hash_size')) {
|
||||
$response->getBody()->write(json_encode([
|
||||
'message' => $this->translator->trans('error.file_size_exceeded'),
|
||||
]));
|
||||
|
||||
return $response->withStatus(500, $this->translator->trans('error.file_size_exceeded'));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user