replaced generic errors (strings) with specific error classes