Modified logic of ErrorHandler mapping to *Exception.

Add logic to try to resolve *Exception class in case
RemoteWebDriver doesn’t use a Selenium Java
Error Classes.

Fixes #7437.