Commit 11e3ab65 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

help text for error code 500

parent 80ae5e0c
Pipeline #3267 passed with stage
in 1 minute and 7 seconds
......@@ -239,6 +239,26 @@ function api_endpoint() {
+ process.env.REACT_APP_API_ENDPOINT)
}
function renderError(msg) {
console.log(msg)
if (!msg.startsWith('500 '))
return (<pre>{msg}</pre>);
return (<React.Fragment>
<pre>{msg}</pre>
<Typography color="error">
Our server automatically kills requests that take longer
than 40 seconds, or that require too much memory.<br/> If you
do <i>not</i> think that is the case here, please send a screenshot
and any helpful detail to <a href="mailto:spot@lrde.epita.fr">
<code>spot@lrde.epita.fr</code></a>.
<br/>If you <i>do</i> think that is the case, please
consider <a href="https://spot.lrde.epita.fr/install.html">
installing Spot</a> to run your experiments locally; this is a
shared service.
</Typography>
</React.Fragment>)
}
function handleErrors(response) {
if (!response.ok) {
throw Error(response.status + ' ' + response.statusText);
......@@ -623,7 +643,7 @@ class LtlRewrite extends React.Component {
this.setState({ result: null});
}).catch(error => {
clearTimeout(this.timer);
this.setState({ result: <pre>{error.message}</pre> });
this.setState({ result: renderError(error.message) });
});
}
......@@ -775,7 +795,7 @@ class LtlStudy extends React.Component {
this.setState({ result: this.buildResult(res) });
}).catch(error => {
clearTimeout(this.timer);
this.setState({ result: <pre>{error.message}</pre> });
this.setState({ result: renderError(error.message) });
});
}
......@@ -880,7 +900,7 @@ class LtlTranslate extends React.Component {
this.setState({ result: this.buildResult(res) });
}).catch(error => {
clearTimeout(this.timer);
this.setState({ result: () => <pre>{error.message}</pre> });
this.setState({ result: () => renderError(error.message) });
});
}
......@@ -1111,7 +1131,7 @@ class LtlCompare extends React.Component {
this.setState({ result: this.buildResult(res) });
}).catch(error => {
clearTimeout(this.timer);
this.setState({ result: <pre>{error.message}</pre> });
this.setState({ result: renderError(error.message) });
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment