Commit 7f58cebe authored by anton's avatar anton

Metadata store properly handles not found and access denied responses

parent 96833f86
......@@ -93,7 +93,8 @@
await _this.fetchMetadata()
}
catch (err) {
if (err.message === 'ENOENT') throw new Error('errors.media_could_not_be_accessed')
if (err.message && err.message.indexOf('ENOENT') === 0) throw new Error('errors.media_could_not_be_accessed')
if (err.message && err.message.indexOf('EACCESS') === 0) throw new Error('errors.access_to_media_denied')
else throw err
}
let
......
......@@ -41,7 +41,8 @@ const metadata = {
}
}
catch (err) {
if (err.message === 'ENOENT') throw new Error(err.message)
if (err.message && err.message.indexOf('ENOENT') === 0) throw new Error(err.message)
if (err.message && err.message.indexOf('EACCESS') === 0) throw new Error(err.message)
if (!err.response || err.response.status > 404) console.error(err.message)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment