add support for codes/messages for predefined errors
add tests to error classes