-
Notifications
You must be signed in to change notification settings - Fork 222
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
Panic in Playground shows bad error message #3848
Comments
This is because the compiler panics here:
So we could split this into a couple of issues — the panic on this query, and the playground showing better error messages for panics. On the panic display — we have prql/prqlc/bindings/js/Cargo.toml Line 34 in 23494d1
|
I always wondered what a panic would look like in the Playground... Not much evidence, except the peculiar behavior shown above. I see this in the browser Console:
|
Ah, great, I missed this. So the
I think it's basically not possible to show it in the error-pane, since the thing that would show it has exited. So we should just try and not panic, and any panic is a bug... Do you want to adjust this issue to specify this as a compiler bug for panicking? |
Hmmm... I had started speculating on this, and asked ChatGPT "how can I intercept javascript calls to console.error()" and it gave the answer below. (Actually, this is one of two substantially similar answers.) My thought was, "all we need to do" is drop this code into some main JS file (this is where my knowledge of the programs structure gets really fuzzy). This replacement function then passes the argument (or some portion of it) to code that sets the text in the Or have I missed your point?
Updated to call the other function, which is closer to what I intended. |
I think you might well be right! If we can intercept the panic and put the message in the error pane, that could work well. (I'm extremely bad at JS, so I won't be the person to do this, and possibly I shouldn't be opining on it. But I would very much welcome a solution, either to this or to getting this to show an error, which isn't even a panic: prql target:sql.postgres
# ) |
I wonder if @vanillajonathan could take a shot at catching the panic message, since he did the Vite.js conversion... @max-sixty - I won't let you say, "I'm bad at this..." Don't run yourself down :-) I would accept your statement something like, "I'm not comfortable in the JS environment, so I won't be the person to do this..." Thanks as always. |
Okay, the playground is fixed now, but the compiler still needs to be fixed. |
PR #3870 focuses on the compiler panic. I am closing this as suggested by @max-sixty |
What happened?
When editing a query in the Playground (using 1759a86 from 25 Nov 2023) the query looks OK when pasted in. But editing
inv.name
in the nestedgroup
, the displayed error message is incorrect.in.name
correctly shows an errorI made a video of the behavior... https://youtube.com/shorts/uB66piyGihI?feature=share
NB: It helps to reload the Playground before starting the experiment
PRQL input
SQL output
N/A
Expected SQL output
N/A
MVCE confirmation
Anything else?
No response
The text was updated successfully, but these errors were encountered: