mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-25 18:38:55 +00:00
creates top-level application error substate
This commit is contained in:
parent
e7b151dd48
commit
c20ab5a054
@ -500,14 +500,16 @@ export default Route.extend({
|
|||||||
const datasetUrl = `${datasetsUrlRoot}/${dataset_id}`;
|
const datasetUrl = `${datasetsUrlRoot}/${dataset_id}`;
|
||||||
|
|
||||||
return Promise.resolve(getJSON(datasetUrl))
|
return Promise.resolve(getJSON(datasetUrl))
|
||||||
.then(({ status, dataset }) => {
|
.then(({ status, dataset, message = '' }) => {
|
||||||
return status === 'ok' && isPresent(dataset)
|
return status === 'ok' && isPresent(dataset) ?
|
||||||
? dataset
|
dataset :
|
||||||
: Promise.reject(
|
Promise.reject(
|
||||||
new Error(`Request for ${datasetUrl} failed with: ${status}`)
|
new Error(
|
||||||
);
|
`Request for ${datasetUrl} failed with status: ${status}.
|
||||||
})
|
${message}`
|
||||||
.catch(() => ({}));
|
)
|
||||||
|
);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
9
wherehows-web/app/templates/application-error.hbs
Normal file
9
wherehows-web/app/templates/application-error.hbs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<div class="wh-login-container">
|
||||||
|
<img src="/assets/assets/images/landing-logo.png"
|
||||||
|
alt="WhereHows Logo">
|
||||||
|
<p>Oops an error occurred!</p>
|
||||||
|
|
||||||
|
{{if model.message model.message ""}}
|
||||||
|
|
||||||
|
{{link-to "Back to safety" "application"}}
|
||||||
|
</div>
|
Loading…
x
Reference in New Issue
Block a user