Updated API fails to log the error code