Error handling improvement for simulator:

Fixed error status code assignment in the error response message such
that INVALID_REQUEST is set only if a finer grained error status code
was not already set.