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

stack trace tranucated #150

Open
sigmaSd opened this issue Jun 7, 2023 · 6 comments
Open

stack trace tranucated #150

sigmaSd opened this issue Jun 7, 2023 · 6 comments

Comments

@sigmaSd
Copy link
Contributor

sigmaSd commented Jun 7, 2023

Don't know if its a dax or a deno issue, or if its the way things works
But It would be great if this can be fixed

code:

import { $ } from "https://deno.land/x/[email protected]/mod.ts";
await $`donotexistbinary`;

result

Uncaught Error: Command not found: donotexistbinary
    at resolveCommand (https://deno.land/x/[email protected]/src/shell.ts:773:11)
    at eventLoopTick (ext:core/01_core.js:182:11)
    at async executeCommandArgs (https://deno.land/x/[email protected]/src/shell.ts:5
71:27)
    at async executeSimpleCommand (https://deno.land/x/[email protected]/src/shell.ts
:560:10)
    at async executeSequentialList (https://deno.land/x/[email protected]/src/shell.t
s:386:20)
    at async spawn (https://deno.land/x/[email protected]/src/shell.ts:375:18)
    at async CommandChild.pipedStdoutBuffer (https://deno.land/x/[email protected]/sr
c/command.ts:572:20)

The stack doesn't reach to user code

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Jun 8, 2023

Actually this issue is annoying in practice, when I get such errors, I don't know here to look, and I have to add logs everywhere

I wonder if this is just a javascript limitation

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Jun 9, 2023

At least I found a workaround , set this somewhere at the start $.setPrintCommand(true);
Maybe this should be mentioned in the docs, its useful so far

@dsherret
Copy link
Owner

dsherret commented Jun 9, 2023

Probably this is denoland/deno#18946

Here's a small reproduction:

async function a() {
  await new Promise((resolve, reject) => {
    setTimeout(() => {
      reject(new Error("test"));
    }, 20);
  });
}

try {
  await a();
} catch (err) {
  console.log(err.stack);
}

Edit: No this is wrong.

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Jun 25, 2023

@dsherret
Copy link
Owner

dsherret commented Feb 4, 2024

Probably Error.captureStackTrace could be used here to improve the stack trace. I just did something similar in #236

I'll try to look into it soon.

@dsherret
Copy link
Owner

I opened denoland/deno#23146

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

No branches or pull requests

2 participants