It’s best to put error/warning messages in very passive, non-blaming language, especially if users might see them. Avoid exclamation marks unless something is seriously wrong and they need to take immediate action, and in that case tell them which actions to take.
It can be difficult to give non-technical people meaningful info, with enough tech detail for the dev to actually find and fix a problem. Specifically, the example below is validating data prior to record creation. The message could be phrased like (“Sorry, there was a problem saving the programming step.\n\nError details: missing ID. Mes_product_id:” + mes_product_id +” Mes_route_step_id:” + mes_route_step_id)
//Check that all Guid strings are not empty
if (mes_product_id.Equals(“”) || mes_route_step_id.Equals(“”) || mes_station_id.Equals(“”))
throw new Exception(“At least one ID is empty!”);
And then to be super-nice, you might even help them out with some instructions like “try again by doing this thing instead”, or “contact your supervisor or MES Admin if this problem continues.”