Move error handling code to post json parsing.