Make HubException a JS Error object