Improving error message for cost check.

issue3568
review2451003