Skip to content

Commit

Permalink
handle SQLIntegrityConstraintViolationException, Column cannot be nu…
Browse files Browse the repository at this point in the history
…ll (#47)
  • Loading branch information
sim-wangyan committed Apr 6, 2022
1 parent 63ac444 commit 688cd84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.xream.sqli.repository.exception;
package io.xream.sqli.exception;

/**
* @author Sim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public static Throwable unwrapThrowable(Throwable wrapped) {
} else if (unwrapped instanceof UndeclaredThrowableException) {
unwrapped = ((UndeclaredThrowableException) unwrapped).getUndeclaredThrowable();
} else {
Throwable t = wrapped.getCause();
if (t != null)
return t;
return unwrapped;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
import io.xream.sqli.core.RowHandler;
import io.xream.sqli.dialect.Dialect;
import io.xream.sqli.exception.ExceptionTranslator;
import io.xream.sqli.exception.SqliRumtimeException;
import io.xream.sqli.page.Page;
import io.xream.sqli.parser.BeanElement;
import io.xream.sqli.parser.Parsed;
import io.xream.sqli.parser.Parser;
import io.xream.sqli.repository.exception.SqliRumtimeException;
import io.xream.sqli.repository.exception.TooManyResultsException;
import io.xream.sqli.repository.init.SqlInit;
import io.xream.sqli.repository.init.SqlTemplate;
Expand Down

0 comments on commit 688cd84

Please sign in to comment.