Skip to content

Commit de6327d

Browse files
authored
Merge pull request #95 from nspcc-dev/feature/94-handle_missing_objects
2 parents 765e6ef + 5bff588 commit de6327d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Load.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const Load = ({
3232
objectId: objectIDTemp,
3333
});
3434
}).catch(() => {
35-
onModal('failed', 'Something went wrong, try again');
35+
onModal('failed', 'Object not found: missing or expired');
3636
});
3737
} else {
3838
onRedirect('/');

src/api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export default function api(method, url, params = {}, headers = {}) {
3131
resolve({ status: 'success' });
3232
} else {
3333
let res = response;
34-
if (method === 'HEAD' && response.headers) {
34+
if (method === 'HEAD' && response.status !== 200) {
35+
reject(res);
36+
} else if (method === 'HEAD' && response.headers) {
3537
const res = {
3638
'filename': response.headers.get('X-Attribute-Filename'),
3739
'containerId': response.headers.get('X-Container-Id'),

0 commit comments

Comments
 (0)