Elffuss BraidHub

kikocis/java-driver public

JAVA-1246: Driver swallows the real exception in a few cases
Changesetc064b2b20c54532b384ddff4d54a0b1bd7d1e75c88e020ec0aecde4f02f6fa02
AuthorVishy Kasar <vkasar@apple.com> · 2016-07-14 11:53 -07:00
Committerolim7t <omichallat+github@gmail.com> · 2016-08-30 13:22 -07:00
Parents1b13768b4d6e

Browse the files at this changeset

5 files changed

modified changelog/README.md +1 −0
@@ -2,6 +2,7 @@
22
33 ### 3.0.4 (in progress)
44
5+- [improvement] JAVA-1246: Driver swallows the real exception in a few cases
56
67 ### 3.0.3
78
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +1 −1
@@ -846,7 +846,7 @@
846846 addContactPoints(InetAddress.getAllByName(address));
847847 return this;
848848 } catch (UnknownHostException e) {
849- throw new IllegalArgumentException(e.getMessage());
849+ throw new IllegalArgumentException("Failed to add contact point: " + address, e);
850850 }
851851 }
852852
modified driver-core/src/main/java/com/datastax/driver/core/Frame.java +2 −2
@@ -234,9 +234,9 @@
234234 // it there).
235235 return Frame.create(frame);
236236 } catch (CorruptedFrameException e) {
237- throw new DriverInternalError(e.getMessage());
237+ throw new DriverInternalError(e);
238238 } catch (TooLongFrameException e) {
239- throw new DriverInternalError(e.getMessage());
239+ throw new DriverInternalError(e);
240240 }
241241 }
242242 }
modified driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java +2 −0
@@ -29,6 +29,7 @@
2929 * Note: it's not an interface mainly because we don't want to expose it.
3030 */
3131 abstract class ReplicationStrategy {
32+ private static final Logger logger = LoggerFactory.getLogger(ReplicationStrategy.class);
3233
3334 static ReplicationStrategy create(Map<String, String> replicationOptions) {
3435
@@ -55,6 +56,7 @@
5556 }
5657 } catch (NumberFormatException e) {
5758 // Cassandra wouldn't let that pass in the first place so this really should never happen
59+ logger.error("Failed to parse replication options: " + replicationOptions, e);
5860 return null;
5961 }
6062 }
modified driver-core/src/test/java/com/datastax/driver/core/TestUtils.java +1 −1
@@ -729,7 +729,7 @@
729729 try {
730730 socket.close();
731731 } catch (IOException e) {
732- logger.warn("Error closing socket to " + address);
732+ logger.warn("Error closing socket to " + address, e);
733733 }
734734 }
735735 return connectionSuccessful;