Reorganize exceptions hierarchy

Description

After and JAVA-720, new subclasses have been created under DriverInternalError: OverloadedException, BootstrappingException, ProtocolError, ServerError, and UnpreparedException.

While they were meant to be handled internally, they have been permeating through the driver's API:

  • since the query logger / latency tracker ();

  • and would be even more visible if they are also exposed through the enhanced RetryPolicy ().

It's also worth noting that NoHostAvailableException.getErrors() avoids exposing these exceptions by replacing them with a generic DriverException - which is clumsy.

The fact that they inherit from DriverInternalError makes one believe that they denote a bug in the driver, which is not always the case.

  • ServerError denotes a server-side bug and could remain under DriverInternalError

  • ProtocolError is generally a driver-side bug and could remain under DriverInternalError

  • OverloadedException is a query execution error and should be placed under QueryExecutionException

  • BootstrappingException is a query execution error and should be placed under QueryExecutionException

  • UnpreparedException is a query validation error and should be placed under QueryValidationException

It might also be a good idea to promote ConnectionException and subclasses to package com.datastax.driver.core.exceptions and make them public as well (they also appear in NoHostAvailableException as well as in the Query Logger).

And finally, the checked BusyConnectionException also appears in NoHostAvailableException.

Environment

None

Pull Requests

None

Assignee

Unassigned

Reporter

Alexandre Dutra

Labels

None

PM Priority

None

Affects versions

Fix versions

Pull Request

None

Doc Impact

None

Size

XS

External issue ID

None

External issue ID

None

Priority

Minor
Configure