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

The functions which caused an exception are sometimes omitted from the stacktrace #2646

Open
guyguy2001 opened this issue Oct 4, 2024 · 3 comments

Comments

@guyguy2001
Copy link

guyguy2001 commented Oct 4, 2024

I just had an exception while running some functions in the REPL (via alt-enter), and the relevant functions in my code that actually caused the exception weren't show in the stack-trace calva gave me.

I took a look at #2029, but it seems like there the relevant functions were actually printed, so I believe this isn't a duplicate.

When running this, I get a stack trace which claims that the exception occured in clojure-adventure.vec2/-apply-items, but it doesn't show in the stack trace:
image
image

However, if I wrap it in a try/catch, I can see -apply-items and the functions that called it in the stack trace:
image

I have since found and fixed the error, and found that it was a relatively boring "everything was nil and so the function crashed", no special macros or anything - so I have no idea why the stacktrace acted weirdly.

My settings

  "calva.paredit.defaultKeyMap": "strict",
  "[.cljs]": {
    "editor.defaultFormatter": "betterthantomorrow.calva"
  },
  "calva.useLegacyReplWindowPath": false,
  "calva.autoOpenREPLWindow": true,
  "calva.outputDestinations": {
    "evalResults": "terminal",
    "evalOutput": "terminal",
    "otherOutput": "terminal"
  },
  "calva.highlight.commentFormStyle": {},

Running this yourself

I have a reproducible (for me) version of this at https://github.com/guyguy2001/clojure-adventure in the calva-reproduction/stacktrace tag.

Connect to the repl (using the default lein profile), go to src\clojure_adventure\fiddles\ui_fiddle.clj, and ctrl-click the sections after 1. and 3. to get the weird behvaiour, or 1. and 2. to get the actual stack trace.

image

I could make a lighter reproduction if it's needed, but I'll wait for an initial opinion of the issue (e.g. is this a silly dup or user error) before putting time into it

@PEZ
Copy link
Collaborator

PEZ commented Oct 7, 2024

Hello! Sorry for belated reply, I almost missed this issue for some reason.

Calva does some filtering on the stacktrace before printing it:

https://github.com/BetterThanTomorrow/calva/blob/dev/src/repl-window/repl-doc.ts#L466

I don't know why that item should fall victim to the filter, but it's either that, or Calva never sees that item. I can have a look, but it could be more effective if you check it out. I don't recall if you have run Calva in development or not. Please let me know if you wanna have a go at it and if you need any pointers. Otherwise I'll have a look.

@guyguy2001
Copy link
Author

I'll try to give it a look over the weekend - I'll tell you how it goes and if I need help running stuff

@PEZ
Copy link
Collaborator

PEZ commented Oct 7, 2024

Awesome! We keep the docs for how to get the dev environment up and running in the wiki. (You probably knew, but anyway 😄)

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