Log filesystem fetch failures

This commit is contained in:
momo5502
2025-09-27 11:55:54 +02:00
parent 78b35b064b
commit cfd0d7cf21

View File

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