From 885d0b5453ffbf5c24ea903f766660acb43ed7db Mon Sep 17 00:00:00 2001 From: Ben Wheeler <wheeler.benjamin@gmail.com> Date: Tue, 23 Oct 2018 12:05:41 -0400 Subject: [PATCH] error can be object or string --- src/containers/gui.jsx | 4 ++-- src/lib/project-fetcher-hoc.jsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/containers/gui.jsx b/src/containers/gui.jsx index 6fd1b3be6..459d6ad66 100644 --- a/src/containers/gui.jsx +++ b/src/containers/gui.jsx @@ -66,7 +66,7 @@ class GUI extends React.Component { render () { if (this.props.isError) { throw new Error( - `Failed to load project from server [id=${window.location.hash}]: ${this.props.error}`); + `Error in Scratch GUI [location=${window.location}]: ${this.props.error}`); } const { /* eslint-disable no-unused-vars */ @@ -101,7 +101,7 @@ class GUI extends React.Component { GUI.propTypes = { assetHost: PropTypes.string, children: PropTypes.node, - error: PropTypes.object, // eslint-disable-line react/forbid-prop-types + error: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), fetchingProject: PropTypes.bool, hideIntro: PropTypes.bool, importInfoVisible: PropTypes.bool, diff --git a/src/lib/project-fetcher-hoc.jsx b/src/lib/project-fetcher-hoc.jsx index ab8325b5f..ad2aecd17 100644 --- a/src/lib/project-fetcher-hoc.jsx +++ b/src/lib/project-fetcher-hoc.jsx @@ -75,7 +75,7 @@ const ProjectFetcherHOC = function (WrappedComponent) { } }) .catch(err => { - this.props.onError(`Saving the project failed with error: ${err}`); + this.props.onError(err); log.error(err); }); } -- GitLab