mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-24 10:00:07 +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}`;
|
||||
|
||||
return Promise.resolve(getJSON(datasetUrl))
|
||||
.then(({ status, dataset }) => {
|
||||
return status === 'ok' && isPresent(dataset)
|
||||
? dataset
|
||||
: Promise.reject(
|
||||
new Error(`Request for ${datasetUrl} failed with: ${status}`)
|
||||
);
|
||||
})
|
||||
.catch(() => ({}));
|
||||
.then(({ status, dataset, message = '' }) => {
|
||||
return status === 'ok' && isPresent(dataset) ?
|
||||
dataset :
|
||||
Promise.reject(
|
||||
new Error(
|
||||
`Request for ${datasetUrl} failed with status: ${status}.
|
||||
${message}`
|
||||
)
|
||||
);
|
||||
});
|
||||
},
|
||||
|
||||
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