52 changed files with 423 additions and 156 deletions
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.common.exception.file; |
|||
|
|||
import java.io.PrintStream; |
|||
import java.io.PrintWriter; |
|||
|
|||
/** |
|||
* 文件上传异常类 |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
public class FileUploadException extends Exception |
|||
{ |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private final Throwable cause; |
|||
|
|||
public FileUploadException() |
|||
{ |
|||
this(null, null); |
|||
} |
|||
|
|||
public FileUploadException(final String msg) |
|||
{ |
|||
this(msg, null); |
|||
} |
|||
|
|||
public FileUploadException(String msg, Throwable cause) |
|||
{ |
|||
super(msg); |
|||
this.cause = cause; |
|||
} |
|||
|
|||
@Override |
|||
public void printStackTrace(PrintStream stream) |
|||
{ |
|||
super.printStackTrace(stream); |
|||
if (cause != null) |
|||
{ |
|||
stream.println("Caused by:"); |
|||
cause.printStackTrace(stream); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void printStackTrace(PrintWriter writer) |
|||
{ |
|||
super.printStackTrace(writer); |
|||
if (cause != null) |
|||
{ |
|||
writer.println("Caused by:"); |
|||
cause.printStackTrace(writer); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Throwable getCause() |
|||
{ |
|||
return cause; |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.ruoyi.common.exception.user; |
|||
|
|||
/** |
|||
* 黑名单IP异常类 |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
public class BlackListException extends UserException |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public BlackListException() |
|||
{ |
|||
super("login.blocked", null); |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.ruoyi.common.exception.user; |
|||
|
|||
/** |
|||
* 用户不存在异常类 |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
public class UserNotExistsException extends UserException |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public UserNotExistsException() |
|||
{ |
|||
super("user.not.exists", null); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue