Return proper exception class