Skip to content

Commit

Permalink
remove custom error and adjust error message
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Aug 10, 2023
1 parent 29edb92 commit 59c9e41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,3 @@ export class ErrGasLimitShouldBe0ForInnerTransaction extends Err {
super("gas limit must be 0 for the inner transaction for relayed v2");
}
}

/**
* Signals an optional class member is undefined
*/
export class ErrOptionalClassMemberIsUndefined extends Err {
public constructor(message: string) {
super(message);
}
}
4 changes: 2 additions & 2 deletions src/transactionWatcher.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AsyncTimer } from "./asyncTimer";
import { Err, ErrExpectedTransactionEventsNotFound, ErrExpectedTransactionStatusNotReached, ErrOptionalClassMemberIsUndefined } from "./errors";
import { Err, ErrExpectedTransactionEventsNotFound, ErrExpectedTransactionStatusNotReached } from "./errors";
import { ITransactionFetcher } from "./interface";
import { ITransactionEvent, ITransactionOnNetwork, ITransactionStatus } from "./interfaceOfNetwork";
import { Logger } from "./logger";
Expand Down Expand Up @@ -71,7 +71,7 @@ export class TransactionWatcher {
public async awaitCompleted(transaction: ITransaction): Promise<ITransactionOnNetwork> {
const isCompleted = (transactionOnNetwork: ITransactionOnNetwork) => {
if (transactionOnNetwork.isCompleted === undefined) {
throw new ErrOptionalClassMemberIsUndefined("`isCompleted` is undefined. getTransaction() should be called using `withProcessStatus=true`.");
throw new Err("The transaction watcher requires the isCompleted property to be defined on the transaction object. Perhaps you've used the sdk-network-provider's getTransaction() and in that case you should also pass `withProcessStatus=true`.");
}
return transactionOnNetwork.isCompleted
};
Expand Down

0 comments on commit 59c9e41

Please sign in to comment.