Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cnooc_zydeepen-cggl_expert-manage-miniapp
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙德龙
cnooc_zydeepen-cggl_expert-manage-miniapp
Commits
2fedd938
Commit
2fedd938
authored
Nov 13, 2025
by
weisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change order
parent
12614ee5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
src/main/java/com/cnooc/expert/common/exception/GlobalExceptionHandler.java
+7
-5
No files found.
src/main/java/com/cnooc/expert/common/exception/GlobalExceptionHandler.java
View file @
2fedd938
...
...
@@ -45,11 +45,7 @@ public class GlobalExceptionHandler {
/**
* 处理其他异常
*/
@ExceptionHandler
(
Exception
.
class
)
public
ApiResult
<
String
>
handleException
(
Exception
e
,
HttpServletRequest
request
)
{
log
.
error
(
"系统异常: {},请求URL: {}"
,
e
.
getMessage
(),
request
.
getRequestURI
(),
e
);
return
ApiResult
.
error
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
GlobalErrorCodeConstants
.
SYSTEM_ERROR
.
getMsg
());
}
@ExceptionHandler
(
BusinessException
.
class
)
public
ApiResult
<
String
>
handleBusinessException
(
BusinessException
e
,
HttpServletRequest
request
)
{
...
...
@@ -62,4 +58,10 @@ public class GlobalExceptionHandler {
log
.
error
(
"空指针异常: {},请求URL: {}"
,
e
.
getMessage
(),
request
.
getRequestURI
(),
e
);
return
ApiResult
.
error
(
GlobalErrorCodeConstants
.
SYSTEM_ERROR
.
getCode
(),
GlobalErrorCodeConstants
.
SYSTEM_ERROR
.
getMsg
());
}
@ExceptionHandler
(
Exception
.
class
)
public
ApiResult
<
String
>
handleException
(
Exception
e
,
HttpServletRequest
request
)
{
log
.
error
(
"系统异常: {},请求URL: {}"
,
e
.
getMessage
(),
request
.
getRequestURI
(),
e
);
return
ApiResult
.
error
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
GlobalErrorCodeConstants
.
SYSTEM_ERROR
.
getMsg
());
}
}
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