From 3ee8e1bdc8fd246e7fbf76a557a86015b150b337 Mon Sep 17 00:00:00 2001 From: Timur Bolotov Date: Wed, 8 Mar 2023 21:07:03 +0600 Subject: [PATCH 1/5] feat: overload constructor to SerializationError class Signed-off-by: Timur Bolotov --- lib/errors.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/errors.d.ts b/lib/errors.d.ts index 659975167..c81fdd2f3 100644 --- a/lib/errors.d.ts +++ b/lib/errors.d.ts @@ -69,6 +69,7 @@ export declare class SerializationError extends OpenSearchClientError { message: string; data: any; constructor(message: string, data: any); + constructor(message: string); } export declare class DeserializationError extends OpenSearchClientError { From 2344d7ea8ca320548e15affdf5f7bb683f7cae5d Mon Sep 17 00:00:00 2001 From: Timur Bolotov Date: Wed, 8 Mar 2023 22:42:47 +0600 Subject: [PATCH 2/5] refactor: remove unnecessary data argument Signed-off-by: Timur Bolotov --- lib/errors.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/errors.js b/lib/errors.js index a8e63e77d..82bedd709 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -70,7 +70,7 @@ class NoLivingConnectionsError extends OpenSearchClientError { class SerializationError extends OpenSearchClientError { constructor(message, data) { - super(message, data); + super(message); Error.captureStackTrace(this, SerializationError); this.name = 'SerializationError'; this.message = message || 'Serialization Error'; @@ -80,7 +80,7 @@ class SerializationError extends OpenSearchClientError { class DeserializationError extends OpenSearchClientError { constructor(message, data) { - super(message, data); + super(message); Error.captureStackTrace(this, DeserializationError); this.name = 'DeserializationError'; this.message = message || 'Deserialization Error'; From 15912e3109ed24e6c151c856c9abcffe1d433060 Mon Sep 17 00:00:00 2001 From: Timur Bolotov Date: Wed, 8 Mar 2023 22:47:18 +0600 Subject: [PATCH 3/5] fix: remove overload Signed-off-by: Timur Bolotov --- lib/errors.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/errors.d.ts b/lib/errors.d.ts index c81fdd2f3..659975167 100644 --- a/lib/errors.d.ts +++ b/lib/errors.d.ts @@ -69,7 +69,6 @@ export declare class SerializationError extends OpenSearchClientError { message: string; data: any; constructor(message: string, data: any); - constructor(message: string); } export declare class DeserializationError extends OpenSearchClientError { From 12bc893a21ecf170595045db7c879b2598c46cdd Mon Sep 17 00:00:00 2001 From: Timur Bolotov Date: Thu, 9 Mar 2023 00:13:18 +0600 Subject: [PATCH 4/5] chore: update changelog Signed-off-by: Timur Bolotov --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf2ecfbd7..89cfe3f21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Documented all API methods ([#335](https://github.com/opensearch-project/opensearch-js/issues/335)) - Added point in time APIs ([#348](https://github.com/opensearch-project/opensearch-js/pull/348)) - Added support for Amazon OpenSearch Serverless ([#356](https://github.com/opensearch-project/opensearch-js/issues/356)) +- Removed unnecessary `data` argument when invoking `OpenSearchClientError` ([#420](https://github.com/opensearch-project/opensearch-js/issues/420)) ### Dependencies - Bumps `xmlbuilder2` from 2.4.1 to 3.0.2 From 094b8ac0d73a640b328aba7678ccd0db017ff5e7 Mon Sep 17 00:00:00 2001 From: Timur Bolotov Date: Thu, 9 Mar 2023 00:14:01 +0600 Subject: [PATCH 5/5] fix: link to PR Signed-off-by: Timur Bolotov --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89cfe3f21..77fd81433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Documented all API methods ([#335](https://github.com/opensearch-project/opensearch-js/issues/335)) - Added point in time APIs ([#348](https://github.com/opensearch-project/opensearch-js/pull/348)) - Added support for Amazon OpenSearch Serverless ([#356](https://github.com/opensearch-project/opensearch-js/issues/356)) -- Removed unnecessary `data` argument when invoking `OpenSearchClientError` ([#420](https://github.com/opensearch-project/opensearch-js/issues/420)) +- Removed unnecessary `data` argument when invoking `OpenSearchClientError` ([#421](https://github.com/opensearch-project/opensearch-js/pull/421)) ### Dependencies - Bumps `xmlbuilder2` from 2.4.1 to 3.0.2