Simplified file hashing error message code a bit

This commit is contained in:
Chris Kankiewicz
2020-04-06 12:18:07 -07:00
parent 7cc79c2f19
commit 6b7fc63e76
2 changed files with 1 additions and 9 deletions

View File

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

View File

@@ -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'));
}