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

Display Haskell exceptions in browser #7

Closed
srid opened this issue Apr 22, 2021 · 2 comments
Closed

Display Haskell exceptions in browser #7

srid opened this issue Apr 22, 2021 · 2 comments
Labels
good first issue Good for newcomers

Comments

@srid
Copy link
Owner

srid commented Apr 22, 2021

When rendering a route if the user code throws an exception, display the stacktrace in the browser.

A simple try ... catch around the render function here, with the handler returning the traceback HTML, should do the job:

ema/src/Ema/Server.hs

Lines 64 to 66 in 15eeeb8

routeHtml :: model -> route -> LByteString
routeHtml m r = do
render m r <> emaStatusHtml <> wsClientShim

@srid
Copy link
Owner Author

srid commented Apr 22, 2021

Without handling exceptions the client websocket fails with Invalid frame header error, and this is shown on the server, repeatedly:

image

Here, "Unknown measure: TAGS" is the exception being thrown.

@srid srid pinned this issue Apr 25, 2021
@srid
Copy link
Owner Author

srid commented Apr 25, 2021

Resolution coming, with a trivial UI. It can be latter be enriched

image

@srid srid closed this as completed in a661aa5 Apr 25, 2021
@srid srid unpinned this issue Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant