FEATURE: basic javascript error handling