Improve getElementById error reporting #129
getElementById is typed to return a Maybe, but actually never returns a Nothing in case of failure, but throws an exception. I'd suggest to either actually return a Maybe or remove it from the type to make it clear it throws an exception. Also, the exception is unhelpful for understanding why generating the page failed, making it extremely hard to track down the error.
For now, I wrote this wrapper:
This gives at least the failure reason and the name of the missing element.
Hm, I was sure I tried the wrapper above and it worked, but right now I can't even get that to work. Calling getElementById with an invalid ID will just completely freeze the handler, no error or exception whatsoever. Any workarounds much appreciated! It's very concerning that a single type in a string just silently stops the application with no tools for debugging available.
referenced this issue
Oct 7, 2016
Yup, sorry about that. Threepenny was always a bit on the prototype side, but it's getting more robust now. On the first attempt, you simply ignore all the exceptional code paths.
Looks like this can be closed, then. Please feel free to reopen if necessary!