javascript json parse exception handling