mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ui] add errror handling to /app/{id} endpoint
This commit is contained in:
parent
3a97f69683
commit
33aa9def6e
1 changed files with 9 additions and 5 deletions
|
@ -48,15 +48,19 @@ export default async (kbnServer, server, config) => {
|
|||
server.route({
|
||||
path: '/app/{id}',
|
||||
method: 'GET',
|
||||
handler: function (req, reply) {
|
||||
async handler(req, reply) {
|
||||
const id = req.params.id;
|
||||
const app = uiExports.apps.byId[id];
|
||||
if (!app) return reply(Boom.notFound('Unknown app ' + id));
|
||||
|
||||
if (kbnServer.status.isGreen()) {
|
||||
return reply.renderApp(app);
|
||||
} else {
|
||||
return reply.renderStatusPage();
|
||||
try {
|
||||
if (kbnServer.status.isGreen()) {
|
||||
await reply.renderApp(app);
|
||||
} else {
|
||||
await reply.renderStatusPage();
|
||||
}
|
||||
} catch (err) {
|
||||
reply(Boom.wrap(err));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue