Commit 2a0d5011 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Fixed proxy exception handling to return true error.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6115 b35dd754-fafc-0310-a699-88a17e54d16e
parent cf128584
......@@ -15,6 +15,7 @@ import java.sql.Connection;
import java.sql.SQLException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
/**
* An implementation of the Connection interface that wraps an underlying
......@@ -102,7 +103,12 @@ public class ConnectionWrapper {
}
else {
// Invoke the method normally if all else fails.
return method.invoke(connection, args);
try {
return method.invoke(connection, args);
}
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
}
......
......@@ -15,6 +15,7 @@ import java.sql.*;
import java.util.*;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
/**
* Wraps a Connection object and collects statistics about the database queries
......@@ -666,7 +667,12 @@ public class ProfiledConnection implements InvocationHandler {
}
else {
// Invoke the method normally if all else fails.
return method.invoke(connection, args);
try {
return method.invoke(connection, args);
}
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
}
......@@ -736,7 +742,12 @@ public class ProfiledConnection implements InvocationHandler {
}
// Invoke the method normally if all else fails.
return method.invoke(stmt, args);
try {
return method.invoke(stmt, args);
}
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
}
......@@ -858,7 +869,12 @@ public class ProfiledConnection implements InvocationHandler {
}
// Invoke the method normally if all else fails.
return method.invoke(pstmt, args);
try {
return method.invoke(pstmt, args);
}
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
}
......@@ -980,7 +996,12 @@ public class ProfiledConnection implements InvocationHandler {
}
// Invoke the method normally if all else fails.
return method.invoke(cstmt, args);
try {
return method.invoke(cstmt, args);
}
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment