Commit 9565ed31 authored by NewbieOrange's avatar NewbieOrange
Browse files

Allow custom exceptions to have message or cause

parent 95ea6cee
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -5,4 +5,14 @@ package cn.edu.sustech.cs307.exception;
 * in get method, if there is no Entity about specific id, throw EntityNotFoundException.
 */
public class EntityNotFoundException extends RuntimeException {
    public EntityNotFoundException() {
    }

    public EntityNotFoundException(String message) {
        super(message);
    }

    public EntityNotFoundException(Throwable cause) {
        super(cause);
    }
}
+10 −0
Original line number Diff line number Diff line
@@ -4,4 +4,14 @@ package cn.edu.sustech.cs307.exception;
 * In all add method, if some of parameters are invalid, throw IntegrityViolationException
 */
public class IntegrityViolationException extends RuntimeException {
    public IntegrityViolationException() {
    }

    public IntegrityViolationException(String message) {
        super(message);
    }

    public IntegrityViolationException(Throwable cause) {
        super(cause);
    }
}