Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to hapi version 20 #85406

Merged
merged 15 commits into from
Dec 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Bump @hapi/boom to v9.1.1
This fixes a TypeScript error which means we can get rid of a few
ts-expect-error comments.
watson committed Dec 18, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d77b07990e763c957c142f6ca1f5fc994498dcd9
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@
"@elastic/request-crypto": "1.1.4",
"@elastic/safer-lodash-set": "link:packages/elastic-safer-lodash-set",
"@elastic/search-ui-app-search-connector": "^1.5.0",
"@hapi/boom": "^9.1.0",
"@hapi/boom": "^9.1.1",
"@hapi/cookie": "^11.0.2",
"@hapi/good-squeeze": "6.0.0",
"@hapi/h2o2": "^9.0.2",
1 change: 0 additions & 1 deletion src/core/server/http/router/response_adapter.ts
Original file line number Diff line number Diff line change
@@ -137,7 +137,6 @@ export class HapiResponseAdapter {

const attributes = getErrorAttributes(payload);
if (attributes) {
// @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277).
error.output.payload.attributes = attributes;
}

Original file line number Diff line number Diff line change
@@ -154,7 +154,6 @@ async function fetchByObjects({
const erroredObjects = bulkGetResult.saved_objects.filter((obj) => !!obj.error);
if (erroredObjects.length) {
const err = Boom.badRequest();
// @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277).
err.output.payload.attributes = {
objects: erroredObjects,
};
Original file line number Diff line number Diff line change
@@ -71,7 +71,6 @@ export async function getNonExistingReferenceAsKeys(
);
if (erroredObjects.length) {
const err = Boom.badRequest();
// @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277).
err.output.payload.attributes = {
objects: erroredObjects,
};
1 change: 0 additions & 1 deletion x-pack/plugins/transform/server/routes/api/error_utils.ts
Original file line number Diff line number Diff line change
@@ -130,7 +130,6 @@ export function wrapEsError(err: any, statusCodeToMessageMap: Record<string, any
const causedByChain = extractCausedByChain(caused_by);
const defaultCause = root_cause.length ? extractCausedByChain(root_cause[0]) : undefined;

// @ts-expect-error cause is not defined on payload type
boomError.output.payload.cause = causedByChain.length ? causedByChain : defaultCause;

// Set error message based on the root cause
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1794,10 +1794,10 @@
dependencies:
"@hapi/hoek" "9.x.x"

"@hapi/boom@9.x.x", "@hapi/boom@^9.0.0", "@hapi/boom@^9.1.0":
version "9.1.0"
resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.0.tgz#0d9517657a56ff1e0b42d0aca9da1b37706fec56"
integrity sha512-4nZmpp4tXbm162LaZT45P7F7sgiem8dwAh2vHWT6XX24dozNjGMg6BvKCRvtCUcmcXqeMIUqWN8Rc5X8yKuROQ==
"@hapi/boom@9.x.x", "@hapi/boom@^9.0.0", "@hapi/boom@^9.1.1":
version "9.1.1"
resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.1.tgz#89e6f0e01637c2a4228da0d113e8157c93677b04"
integrity sha512-VNR8eDbBrOxBgbkddRYIe7+8DZ+vSbV6qlmaN2x7eWjsUjy2VmQgChkOKcVZIeupEZYj+I0dqNg430OhwzagjA==
dependencies:
"@hapi/hoek" "9.x.x"