add wrapper for JS exceptions