Add some error handling to analyst javascript client