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

Remove multine error message from stack correctly #12279

Merged
merged 1 commit into from
Mar 14, 2025
Merged

Remove multine error message from stack correctly #12279

merged 1 commit into from
Mar 14, 2025

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Mar 13, 2025

❯ quarto convert "line 1

line 2

line 3

line 4"
ERROR: File not found: 'line 1

line 2

line 3

line 4'

Stack trace:
    at Command.actionHandler (file:///home/cderv/project/quarto-cli/src/command/convert/cmd.ts:54:13)
    at async Command.execute (https://deno.land/x/[email protected]/command/command.ts:1948:7)
    at async Command.parseCommand (https://deno.land/x/[email protected]/command/command.ts:1780:14)
    at async quarto (file:///home/cderv/project/quarto-cli/src/quarto.ts:190:5)
    at async file:///home/cderv/project/quarto-cli/src/quarto.ts:219:5
    at async file:///home/cderv/project/quarto-cli/src/core/main.ts:41:14
    at async mainRunner (file:///home/cderv/project/quarto-cli/src/core/main.ts:43:5)
    at async file:///home/cderv/project/quarto-cli/src/quarto.ts:209:3

I get this now on Linux

Previously it was

❯ quarto convert "line 1

line 2

line 3

line 4"
ERROR: File not found: 'line 1

line 2

line 3

line 4'

Stack trace:

line 2

line 3

line 4'
    at Command.actionHandler (file:///home/cderv/.local/share/qvm/versions/v1.6.42/bin/quarto.js:108237:15)
    at async Command.execute (file:///home/cderv/.local/share/qvm/versions/v1.6.42/bin/quarto.js:8111:13)
    at async Command.parseCommand (file:///home/cderv/.local/share/qvm/versions/v1.6.42/bin/quarto.js:8001:20)
    at async quarto (file:///home/cderv/.local/share/qvm/versions/v1.6.42/bin/quarto.js:126627:9)
    at async file:///home/cderv/.local/share/qvm/versions/v1.6.42/bin/quarto.js:126654:9
    at async mainRunner (file:///home/cderv/.local/share/qvm/versions/v1.6.42/bin/quarto.js:126519:9)
    at async file:///home/cderv/.local/share/qvm/versions/v1.6.42/bin/quarto.js:126645:5
````

(on Windows multiline input is not easy to add so I don't get the same error)

@cscheid do you think this is valid to remove anything in stack before first `  at` line ? 

@cderv cderv linked an issue Mar 13, 2025 that may be closed by this pull request
@cscheid
Copy link
Collaborator

cscheid commented Mar 14, 2025

Yes, this is a good "fix". It's never going to work perfectly. For example, I think this now breaks if a file name matches /^\s*at /. But it's a good enough improvement.

It would be really great if Deno gave JSON-readable stacks.

@cderv
Copy link
Collaborator Author

cderv commented Mar 14, 2025

Ok great! thank you !

@cderv cderv merged commit c1c5a43 into main Mar 14, 2025
47 checks passed
@cderv cderv deleted the error-stack branch March 14, 2025 16:57
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.

Errors with multiline strings are printed incorrectly
2 participants