Skip to content

Commit

Permalink
Merge pull request #124 from streamflow-finance/fix/contract-error-pr…
Browse files Browse the repository at this point in the history
…ototype

fix: fix ContractError prototype
  • Loading branch information
RolginRoman authored Jan 9, 2024
2 parents f651b32 + 248616a commit 441cd7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"packages": [
"packages/*"
],
"version": "5.9.6",
"version": "5.9.7",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
10 changes: 2 additions & 8 deletions packages/stream/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,9 @@ export class ContractError extends Error {
*/
constructor(error: Error, code?: string | null) {
super(error.message); // Call the base class constructor with the error message
this.name = "ContractError"; // Set the name property
this.contractErrorCode = code ?? null;

// Copy properties from the original error
Object.getOwnPropertyNames(error).forEach((key) => {
(this as any)[key] = (error as any)[key];
});

// If you want to capture the stack trace:
this.stack = error.stack;
Object.setPrototypeOf(this, ContractError.prototype);
this.name = "ContractError"; // Set the name property
}
}
2 changes: 1 addition & 1 deletion packages/stream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/stream",
"version": "5.9.6",
"version": "5.9.7",
"description": "JavaScript SDK to interact with Streamflow protocol.",
"main": "dist/index.js",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
Expand Down

0 comments on commit 441cd7b

Please sign in to comment.