We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ec82a7 commit 34fac1bCopy full SHA for 34fac1b
src/HttpBackend.js
@@ -5,7 +5,12 @@ module.exports = class HttpBackend {
5
loadSuperblock() {
6
return fetch(this._url + '/.superblock.txt').then(res => res.text())
7
}
8
- readFile(filepath) {
9
- return fetch(this._url + filepath).then(res => res.arrayBuffer())
+ async readFile(filepath) {
+ const res = await fetch(this._url + filepath)
10
+ if (res.status === 200) {
11
+ return res.arrayBuffer()
12
+ } else {
13
+ throw new Error('ENOENT')
14
+ }
15
16
0 commit comments