Skip to content

Commit

Permalink
[Graph] Improve error message on graph requests (#54230)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Jan 10, 2020
1 parent d95d799 commit fdd1749
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion x-pack/plugins/graph/server/routes/explore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ export function registerExploreRoute({
throw Boom.badRequest(relevantCause.reason);
}

throw Boom.boomify(error);
return response.internalError({
body: {
message: error.message,
},
});
}
}
)
Expand Down
8 changes: 6 additions & 2 deletions x-pack/plugins/graph/server/routes/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import { IRouter } from 'kibana/server';
import { schema } from '@kbn/config-schema';
import Boom from 'boom';
import { LicenseState, verifyApiAccess } from '../lib/license_state';

export function registerSearchRoute({
Expand Down Expand Up @@ -53,7 +52,12 @@ export function registerSearchRoute({
},
});
} catch (error) {
throw Boom.boomify(error, { statusCode: error.statusCode || 500 });
return response.customError({
statusCode: error.statusCode || 500,
body: {
message: error.message,
},
});
}
}
)
Expand Down

0 comments on commit fdd1749

Please sign in to comment.