Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
2f51730a
Commit
2f51730a
authored
Oct 24, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] add exception printstatck
parent
b31299b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
1 deletion
+35
-1
AtmsExceptionHandler.java
...ava/pwc/taxtech/atms/controller/AtmsExceptionHandler.java
+4
-0
Exceptions.java
.../src/main/java/pwc/taxtech/atms/exception/Exceptions.java
+1
-0
ServerErrorException.java
...java/pwc/taxtech/atms/exception/ServerErrorException.java
+27
-0
ApprovalService.java
...va/pwc/taxtech/atms/vat/service/impl/ApprovalService.java
+3
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/AtmsExceptionHandler.java
View file @
2f51730a
...
...
@@ -19,12 +19,16 @@ public class AtmsExceptionHandler extends ResponseEntityExceptionHandler {
protected
ResponseEntity
<
Object
>
handleExceptions
(
Exception
ex
)
throws
ServiceException
{
logger
.
error
(
"Rest Exception!"
,
ex
);
if
(
ex
instanceof
ApplicationException
)
{
ex
.
printStackTrace
();
return
handleApplicationException
((
ApplicationException
)
ex
);
}
else
if
(
ex
instanceof
ServiceException
)
{
ex
.
printStackTrace
();
return
handleServiceException
((
ServiceException
)
ex
);
}
else
if
(
ex
instanceof
ApiException
)
{
ex
.
printStackTrace
();
return
((
ApiException
)
ex
).
handle
();
}
else
{
ex
.
printStackTrace
();
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
build
();
}
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/exception/Exceptions.java
View file @
2f51730a
...
...
@@ -11,4 +11,5 @@ public class Exceptions {
public
static
final
ApiException
EMPTY_PRIODDATE_PARAM
=
new
BadParameterException
(
"period data is empty"
);
public
static
final
ApiException
NOT_FOUND_REPORT_EXCEPTION
=
new
NotFoundException
(
"not found report"
);
public
static
final
ApiException
REPORT_HAS_COMMIT_EXCEPTION
=
new
AlreadyExistsException
(
"report approval has commit"
);
public
static
final
ApiException
SERVER_ERROR_EXCEPTION
=
new
ServerErrorException
(
"server error exception"
);
}
atms-api/src/main/java/pwc/taxtech/atms/exception/ServerErrorException.java
0 → 100644
View file @
2f51730a
package
pwc
.
taxtech
.
atms
.
exception
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
public
class
ServerErrorException
extends
ApiException
{
public
ServerErrorException
()
{
super
();
}
public
ServerErrorException
(
String
message
)
{
super
(
message
);
}
public
ServerErrorException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
public
ServerErrorException
(
Throwable
cause
)
{
super
(
cause
);
}
@Override
public
<
Object
>
ResponseEntity
handle
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
build
();
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ApprovalService.java
View file @
2f51730a
...
...
@@ -25,6 +25,8 @@ import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import
java.util.*
;
import
static
pwc
.
taxtech
.
atms
.
exception
.
Exceptions
.
SERVER_ERROR_EXCEPTION
;
@Service
public
class
ApprovalService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ApprovalService
.
class
);
...
...
@@ -88,7 +90,7 @@ public class ApprovalService {
periodApproveMapper
.
insert
(
pa
);
}
else
{
logger
.
warn
(
"task must not null or size
gt
1"
);
logger
.
warn
(
"task must not null or size
eq
1"
);
}
}
...
...
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