javascript: adding comments for user provided error callback handling