check the domain to figure out the exception class