Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange formatting of additional to extended from Error class on canary build #15999

Open
kravetsone opened this issue Dec 26, 2024 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@kravetsone
Copy link

What version of Bun is running?

1.1.42-canary.19+145a7fd92

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

export class TelegramError extends Error {
	constructor(error, method, params) {
		super(error.description);

		this.name = method;
		this.method = method;
		this.params = params;
		this.code = error.error_code;

		if (error.parameters) this.payload = error.parameters;
	}
}

throw new TelegramError({ description: "test", error_code: 1 }, "test", {});

Bun:

PS Z:\PROJECTS\GRAMIO\core> bun .\repr.mjs
1 | export class TelegramError extends Error {
2 |     constructor(error, method, params) {
3 |             super(error.description);
      ^
test: test
 method: "test",
 params: {},
   code: 1,

      at new TelegramError (Z:\PROJECTS\GRAMIO\core\repr.mjs:3:3)
      at Z:\PROJECTS\GRAMIO\core\repr.mjs:14:7

Bun v1.1.42-canary.19+145a7fd92 (Windows x64)

Node:

PS Z:\PROJECTS\GRAMIO\core> node .\repr.mjs 
file:///Z:/PROJECTS/GRAMIO/core/repr.mjs:14
throw new TelegramError({ description: "test", error_code: 1 }, "test", {});
      ^

test: test
    at file:///Z:/PROJECTS/GRAMIO/core/repr.mjs:14:7
    at ModuleJob.run (node:internal/modules/esm/module_job:268:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5) {
  method: 'test',
  params: {},
  code: 1
}

Node.js v22.10.0

#15985

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

The same result on WSL

@kravetsone kravetsone added bug Something isn't working needs triage labels Dec 26, 2024
@kravetsone kravetsone changed the title Strange formatting of additional to extended from Error class Strange formatting of additional to extended from Error class on canary build Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant