Using correct error message code for - TRUNK-4044(cherry picked from commit b2f09659f7dcafda6cd32bde0be58ec875321be2)