Skip to content

Conversation

dynst
Copy link
Contributor

@dynst dynst commented Oct 16, 2025

They still had the default name "Error".

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Turns out we can even avoid the duplication of the name for ease of maintenance (source).


public constructor(status: number, text: string, expose = true) {
super(text);
this.name = "HttpError";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.name = "HttpError";
this.name = this.constructor.name;


public constructor(message: string, txId: string) {
super(message);
this.name = "TimeoutError";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.name = "TimeoutError";
this.name = this.constructor.name;


public constructor(code: number, codespace: string, log: string | undefined) {
super(`Broadcasting transaction failed with code ${code} (codespace: ${codespace}). Log: ${log}`);
this.name = "BroadcastTxError";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.name = "BroadcastTxError";
this.name = this.constructor.name;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants