mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Adding endpoint missing exception
This commit is contained in:
parent
a52895bf3f
commit
b2e83dcf5d
1 changed files with 3 additions and 2 deletions
|
@ -6,8 +6,9 @@ module.exports = (client) => {
|
|||
if (req.headers.authorization) {
|
||||
_.set(params, 'headers.authorization', req.headers.authorization);
|
||||
}
|
||||
return _.get(client, endpoint)
|
||||
.call(client, params)
|
||||
const api = _.get(client, endpoint);
|
||||
if (!api) throw new Error(`callWithRequest called with an invalid endpoint: ${endpoint}`);
|
||||
return api.call(client, params)
|
||||
.catch((err) => {
|
||||
if (err.status === 401) {
|
||||
const options = { realm: 'Authorization Required' };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue