CRM-11926 Improve error message on APi failure to include DB error message

Is this the right way?