Test two different error types in error message unit tests

- Added coverage for C and Java backends to the error msg tests