-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Uncaught exceptions are silently discarded in 0.7.0.0 (while they are properly displayed in 0.6.0.5) #145
Comments
Thank you for the detailed report! I think this is more than enough to reproduce the issue. My guess is that one of the dependencies (perhaps Probably related to #143 . |
I think that this is a problem with the Snap framework. The latest commit mentioned here works around this quirk by printing any exception to stdout. Does this help? |
Hey @HeinrichApfelmus, I hope to test it further in the coming days and if all is well close this issue. |
I've found another error case: import qualified Graphics.UI.Threepenny as UI
import Graphics.UI.Threepenny.Core
main = startGUI defaultConfig $ \w -> do
getBody w #+ [UI.h1 # set UI.text "before error"]
div <- UI.div # set UI.text (error "This error should be shown")
getBody w #+ [UI.h1 # set UI.text "after error"]
return () The websocket connection gets terminated and the following is printed to stdout:
No other detail or context is shown about the exception. Do you think this case is also related to snapframework/snap-server#94? Edit: Tried with both 14e78bd (2016-12-07) and 95a90ad (2016-12-10). |
Ah, I see, thanks a lot for the report. The problem is that this exception is from a pure value ( |
The API may be called in ways where pure values contain exceptions, e.g. element div # set UI.text (error “oops”) This call will be translated into a message for the JavaScript side. Sending this message will fail, because it contains a _|_ value. We now try to force this exception in the translation phase, because this will result in a better error message.
I have addressed this in the most recent commit f4ac93e . Does this help? |
I was about to report this, good to see it is getting fixed ! |
Expected terminal output, as with 0.6.0.5, showing an uncaught exception:
Instead, output with 0.7.0.0 is like so, no mention of the exception:
To reproduce with 0.7.0.0:
Put the above code in a file, make the file executable, make sure nix is installed, and execute the file. Once the server has started up, visit http://127.0.0.1:8023/ .
(Note: Nix was used so that the example above may be as self-contained as possible; however it is not strictly necessary to reproduce the issue if one makes sure (e.g. with Cabal or Stack) to use the correct version of the
threepenny-gui
package.)nixos-unstable.tar.gz
may be changed in the above code tonixos-15.09.tar.gz
to run withthreepenny-gui-0.6.0.5
.This may already be more than enough information for the issue to be identified; in case however that's not so, please let me know.
The text was updated successfully, but these errors were encountered: