Gracefully handle imperfect unit state data.

When inspecting units for errors, we need to be able to deal with malformed or missing data returned from the API. We already know an error condition exists, so there's no guarantee things will be as they should. Inspect as many fields as possible to determine if there's a relation error. Don't assume a field is actually present; if it isn't, move on.
I'm not following this. There's no relationError in the agentStateData, and this is agentStateInfo, so if the relation appears at all it's an error?