Fail or error depending on error code.