Skip to content

Commit

Permalink
Bump @hapi/boom to v9.1.1
Browse files Browse the repository at this point in the history
This fixes a TypeScript error which means we can get rid of a few
ts-expect-error comments.
  • Loading branch information
watson committed Dec 18, 2020
1 parent 31b9a26 commit d77b079
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/core/server/http/router/response_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
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
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1794,10 +1794,10 @@
dependencies:
"@hapi/hoek" "9.x.x"

"@hapi/[email protected]", "@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/[email protected]", "@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"

Expand Down

0 comments on commit d77b079

Please sign in to comment.