[Graph] Improve error message on graph requests (#54230)

This commit is contained in:
Joe Reuter 2020-01-10 22:00:49 +01:00 committed by GitHub
parent 63d0bf84c8
commit d459270be2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -71,7 +71,11 @@ export function registerExploreRoute({
throw Boom.badRequest(relevantCause.reason);
}
throw Boom.boomify(error);
return response.internalError({
body: {
message: error.message,
},
});
}
}
)

View file

@ -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({
@ -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,
},
});
}
}
)