Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
2494fd30
Commit
2494fd30
authored
Aug 06, 2019
by
suntao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v1' into branch-suntao
* v1: 修改异常信息捕获返回的message 修改异常信息捕获返回的message 数据源配置添加通配符
parents
4354c86c
b088879e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
ApplicationExceptionConfiguration.java
...core/configuration/ApplicationExceptionConfiguration.java
+8
-2
BossDSConfig.java
...ashloanflowboss/core/configuration/data/BossDSConfig.java
+2
-2
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/ApplicationExceptionConfiguration.java
View file @
2494fd30
...
...
@@ -6,6 +6,7 @@ import cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus;
import
cn.quantgroup.cashloanflowboss.core.exception.ApplicationException
;
import
com.fasterxml.jackson.core.io.JsonEOFException
;
import
com.fasterxml.jackson.databind.JsonMappingException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
import
org.springframework.stereotype.Component
;
...
...
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
* <p>
* Created by WeiWei on 2017/5/2.
*/
@Slf4j
@Order
(
1
)
@Component
@RestControllerAdvice
...
...
@@ -34,7 +36,8 @@ public class ApplicationExceptionConfiguration {
*/
@ExceptionHandler
({
ApplicationException
.
class
})
public
Result
applicationExceptionHandler
(
ApplicationException
e
)
{
return
new
Result
<>(
e
.
getStatus
(),
null
,
e
.
getMessage
());
log
.
error
(
"程序员开小差了,系统异常信息:{}"
,
e
.
getMessage
());
return
new
Result
<>(
e
.
getStatus
(),
null
,
e
.
getStatus
().
getMessage
());
}
/**
...
...
@@ -102,7 +105,10 @@ public class ApplicationExceptionConfiguration {
}
}
return
new
Result
<>(
ApplicationStatus
.
INTERNAL_SERVICE_ERROR
,
ApplicationException
.
class
.
isAssignableFrom
(
e
.
getClass
())
?
cause
.
getMessage
()
:
e
.
getMessage
());
String
errorMessage
=
ApplicationException
.
class
.
isAssignableFrom
(
e
.
getClass
())
?
cause
.
getMessage
()
:
e
.
getMessage
();
log
.
error
(
"程序员开小差了,未明确的异常信息:{}"
,
errorMessage
);
return
new
Result
<>(
ApplicationStatus
.
INTERNAL_SERVICE_ERROR
,
ApplicationStatus
.
INTERNAL_SERVICE_ERROR
.
getMessage
());
}
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/data/BossDSConfig.java
View file @
2494fd30
...
...
@@ -20,9 +20,9 @@ import javax.persistence.EntityManagerFactory;
import
javax.sql.DataSource
;
@Configuration
@EntityScan
(
basePackages
=
{
"cn.quantgroup.cashloanflowboss.api.
user
.entity.boss"
})
@EntityScan
(
basePackages
=
{
"cn.quantgroup.cashloanflowboss.api.
*
.entity.boss"
})
@EnableTransactionManagement
@EnableJpaRepositories
(
basePackages
=
{
"cn.quantgroup.cashloanflowboss.api.
user
.repository.boss"
},
@EnableJpaRepositories
(
basePackages
=
{
"cn.quantgroup.cashloanflowboss.api.
*
.repository.boss"
},
entityManagerFactoryRef
=
"bossEntityManager"
,
transactionManagerRef
=
"bossTransactionManager"
)
public
class
BossDSConfig
{
...
...
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