I think you should just pull these apart, and have an if for error, and another for body stuff.  Return early if there are errors, then keep going.  Don't combine so much like this, it's not helpful.