mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-18 19:23:56 +00:00
Log filesystem fetch failures
This commit is contained in:
@@ -190,7 +190,7 @@ export class Playground extends React.Component<
|
||||
return this.state.filesystemPromise;
|
||||
}
|
||||
|
||||
const promise = new Promise<Filesystem>((resolve) => {
|
||||
const promise = new Promise<Filesystem>((resolve, reject) => {
|
||||
if (!force) {
|
||||
this.logLine("Loading filesystem...");
|
||||
}
|
||||
@@ -202,12 +202,20 @@ export class Playground extends React.Component<
|
||||
(percent) => {
|
||||
this.logLine(`Downloading filesystem: ${percent}%`);
|
||||
},
|
||||
).then(resolve);
|
||||
)
|
||||
.then(resolve)
|
||||
.catch(reject);
|
||||
});
|
||||
|
||||
promise.then((filesystem) => this.setState({ filesystem }));
|
||||
this.setState({ filesystemPromise: promise });
|
||||
|
||||
promise.catch((e) => {
|
||||
console.log(e);
|
||||
this.logLine("Failed to fetch filesystem:");
|
||||
this.logLine(e.toString());
|
||||
});
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user