From 1ea9592707f847341d5dbc5f02978ba41c086c10 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Thu, 19 Nov 2020 16:07:23 +0000 Subject: [PATCH] ui: Surface 'detail' of API errors in the error page (#9237) * ui: Surface 'detail' of API errors in the error page * Make UI generated 404s look less bare --- .../consul-ui/app/components/empty-state/index.hbs | 5 ++++- .../consul-ui/app/components/error-state/index.hbs | 14 ++++++++++---- ui/packages/consul-ui/app/routes/application.js | 2 +- .../consul-ui/app/services/repository/dc.js | 3 +-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ui/packages/consul-ui/app/components/empty-state/index.hbs b/ui/packages/consul-ui/app/components/empty-state/index.hbs index e90dbdeb9d..9b16309fe6 100644 --- a/ui/packages/consul-ui/app/components/empty-state/index.hbs +++ b/ui/packages/consul-ui/app/components/empty-state/index.hbs @@ -1,5 +1,8 @@ {{yield}} -
+
{{#if hasHeader}}
{{#yield-slot name="header"}} diff --git a/ui/packages/consul-ui/app/components/error-state/index.hbs b/ui/packages/consul-ui/app/components/error-state/index.hbs index fdff41c07f..039fb4ade8 100644 --- a/ui/packages/consul-ui/app/components/error-state/index.hbs +++ b/ui/packages/consul-ui/app/components/error-state/index.hbs @@ -12,13 +12,19 @@ {{/if}} -

- You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs. -

+ {{#if error.detail}} +

+ {{error.detail}} +

+ {{else}} +

+ You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs. +

+ {{/if}}