Skip to content
Snippets Groups Projects
Commit 4d0983a4 authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Show error screen when project cannot be loaded

parent 9361a376
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,10 @@ const ProjectFetcherHOC = function (WrappedComponent) {
.then(projectAsset => {
if (projectAsset) {
this.props.onFetchedProjectData(projectAsset.data, loadingState);
} else {
// Treat failure to load as an error
// Throw to be caught by catch later on
throw new Error('Could not find project');
}
})
.then(() => {
......
......@@ -47,6 +47,11 @@ describe('Loading scratch gui', () => {
await expect(logs).toEqual([]);
});
test('Nonexistent projects show error screen', async () => {
await loadUri(`${uri}#999999999999999999999`);
await clickText('Oops! Something went wrong.');
});
test('Invalid url when loading project through modal lets you try again', async () => {
await loadUri(uri);
await clickText('View 2.0 Project');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment