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

Colorize errors in Deno.inspect #20451

Open
oscarotero opened this issue Sep 11, 2023 · 1 comment · May be fixed by #21743
Open

Colorize errors in Deno.inspect #20451

oscarotero opened this issue Sep 11, 2023 · 1 comment · May be fixed by #21743
Labels
bug Something isn't working correctly

Comments

@oscarotero
Copy link
Contributor

Hi.
When an Error is throw, Deno shows it with colors. Let's take this code as an example:

// error.ts
function showError () {
  throw new Error('This is an error message');
}

showError();
imaxe

But the same error logged with Deno.inspect with enabled colors doesn't work:

// error.ts
function showError () {
  throw new Error('This is an error message');
}

try {
  showError();
} catch (e) {
  console.log(Deno.inspect(e, { colors: true }));
}
imaxe

It would be great to support colors for Errors in Deno.inspect.

@marvinhagemeister marvinhagemeister added the bug Something isn't working correctly label Sep 11, 2023
@MohammadSu1
Copy link
Contributor

@crowlKats, Can I work on this issue? The PR has not been merged yet. I can help if the issue is still available, as I tried to reproduce it and confirmed that the problem still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants