webathena
webathena copied to clipboard
Error-handling somewhat awkward
I wonder if we can do a little better here. JS already provides an Error class. The context constants probably ought to be classes (er, prototypes). Also might be good to distinguish user-level errors from internal ones. For instance, ReferenceError is probably better left uncaught. Also any ASN.1-level errors. Debug tools can then catch it and we go from there.
We can have an error type per component, and the ui.js top-level handler can whitelist a few to report to the user and re-raise the rest (reporting "oops, something broke").