Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
2687e396
Commit
2687e396
authored
Aug 17, 2017
by
stylefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理异常
parent
c4694d96
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
100 deletions
+26
-100
guns-admin/src/main/java/com/stylefeng/guns/common/exception/BussinessException.java
+6
-41
guns-admin/src/main/java/com/stylefeng/guns/common/exception/ToolBoxException.java
+0
-45
guns-core/src/main/java/com/stylefeng/guns/core/exception/GunsException.java
+20
-14
No files found.
guns-admin/src/main/java/com/stylefeng/guns/common/exception/BussinessException.java
View file @
2687e396
package
com
.
stylefeng
.
guns
.
common
.
exception
;
package
com
.
stylefeng
.
guns
.
common
.
exception
;
import
com.stylefeng.guns.core.exception.GunsException
;
/**
/**
* @Description 业务异常的封装
* @author fengshuonan
* @author fengshuonan
* @Description 业务异常的封装
* @date 2016年11月12日 下午5:05:10
* @date 2016年11月12日 下午5:05:10
*/
*/
@SuppressWarnings
(
"serial"
)
public
class
BussinessException
extends
GunsException
{
public
class
BussinessException
extends
RuntimeException
{
//友好提示的code码
private
int
friendlyCode
;
//友好提示
private
String
friendlyMsg
;
//业务异常跳转的页面
private
String
urlPath
;
public
BussinessException
(
BizExceptionEnum
bizExceptionEnum
){
this
.
friendlyCode
=
bizExceptionEnum
.
getCode
();
this
.
friendlyMsg
=
bizExceptionEnum
.
getMessage
();
this
.
urlPath
=
bizExceptionEnum
.
getUrlPath
();
}
public
int
getCode
()
{
return
friendlyCode
;
}
public
void
setCode
(
int
code
)
{
this
.
friendlyCode
=
code
;
}
public
String
getMessage
()
{
return
friendlyMsg
;
}
public
void
setMessage
(
String
message
)
{
this
.
friendlyMsg
=
message
;
}
public
String
getUrlPath
()
{
return
urlPath
;
}
public
void
setUrlPath
(
String
urlPath
)
{
public
BussinessException
(
BizExceptionEnum
bizExceptionEnum
)
{
this
.
urlPath
=
urlPath
;
super
(
bizExceptionEnum
.
getCode
(),
bizExceptionEnum
.
getMessage
(),
bizExceptionEnum
.
getUrlPath
())
;
}
}
}
}
guns-admin/src/main/java/com/stylefeng/guns/common/exception/ToolBoxException.java
deleted
100644 → 0
View file @
c4694d96
/**
* Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
stylefeng
.
guns
.
common
.
exception
;
import
com.stylefeng.guns.core.support.StrKit
;
/**
* 工具类初始化异常
*/
public
class
ToolBoxException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
8247610319171014183L
;
public
ToolBoxException
(
Throwable
e
)
{
super
(
e
.
getMessage
(),
e
);
}
public
ToolBoxException
(
String
message
)
{
super
(
message
);
}
public
ToolBoxException
(
String
messageTemplate
,
Object
...
params
)
{
super
(
StrKit
.
format
(
messageTemplate
,
params
));
}
public
ToolBoxException
(
String
message
,
Throwable
throwable
)
{
super
(
message
,
throwable
);
}
public
ToolBoxException
(
Throwable
throwable
,
String
messageTemplate
,
Object
...
params
)
{
super
(
StrKit
.
format
(
messageTemplate
,
params
),
throwable
);
}
}
guns-core/src/main/java/com/stylefeng/guns/core/exception/GunsException.java
View file @
2687e396
package
com
.
stylefeng
.
guns
.
core
.
exception
;
package
com
.
stylefeng
.
guns
.
core
.
exception
;
/**
/**
* @Description 业务异常的封装
* @author fengshuonan
* @author fengshuonan
* @Description 业务异常的封装
* @date 2016年11月12日 下午5:05:10
* @date 2016年11月12日 下午5:05:10
*/
*/
@SuppressWarnings
(
"serial"
)
public
class
GunsException
extends
RuntimeException
{
public
class
GunsException
extends
RuntimeException
{
//友好提示的code码
//友好提示的code码
pr
ivate
int
friendlyCode
;
pr
otected
int
friendlyCode
;
//友好提示
//友好提示
pr
ivate
String
friendlyMsg
;
pr
otected
String
friendlyMsg
;
//业务异常跳转的页面
//业务异常跳转的页面
private
String
urlPath
;
protected
String
urlPath
;
public
GunsException
(
GunsExceptionEnum
bizExceptionEnum
){
protected
GunsException
(
int
friendlyCode
,
String
friendlyMsg
,
String
urlPath
)
{
this
.
friendlyCode
=
bizExceptionEnum
.
getCode
();
this
.
setValues
(
friendlyCode
,
friendlyMsg
,
urlPath
);
this
.
friendlyMsg
=
bizExceptionEnum
.
getMessage
();
}
this
.
urlPath
=
bizExceptionEnum
.
getUrlPath
();
public
GunsException
(
GunsExceptionEnum
bizExceptionEnum
)
{
this
.
setValues
(
bizExceptionEnum
.
getCode
(),
bizExceptionEnum
.
getMessage
(),
bizExceptionEnum
.
getUrlPath
());
}
private
void
setValues
(
int
friendlyCode
,
String
friendlyMsg
,
String
urlPath
)
{
this
.
friendlyCode
=
friendlyCode
;
this
.
friendlyMsg
=
friendlyMsg
;
this
.
urlPath
=
urlPath
;
}
}
public
int
getCode
()
{
public
int
getCode
()
{
...
@@ -46,5 +53,4 @@ public class GunsException extends RuntimeException{
...
@@ -46,5 +53,4 @@ public class GunsException extends RuntimeException{
public
void
setUrlPath
(
String
urlPath
)
{
public
void
setUrlPath
(
String
urlPath
)
{
this
.
urlPath
=
urlPath
;
this
.
urlPath
=
urlPath
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment