Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
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
tencent
services
Commits
3664dc3d
Commit
3664dc3d
authored
Aug 07, 2018
by
feixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常数据格式处理
parent
9d6ec5a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
src/Common/Exception/CommonException.php
+1
-1
src/Common/Exception/ExceptionData.php
+4
-2
src/Common/Exception/ExceptionParseData.php
+1
-1
No files found.
src/Common/Exception/CommonException.php
View file @
3664dc3d
...
...
@@ -36,7 +36,7 @@ class CommonException extends Exception
}
if
(
isset
(
$params
[
'path'
])
)
{
$this
->
path
=
$params
[
'path'
];
$this
->
path
=
empty
(
$params
[
'path'
])
?
[]
:
$params
[
'path'
];
}
...
...
src/Common/Exception/ExceptionData.php
View file @
3664dc3d
...
...
@@ -36,10 +36,12 @@ class ExceptionData
"errCode"
=>
is_callable
([
$e
,
'getErrCode'
])
?
$e
->
getErrcode
()
:
''
,
'path'
=>
[],
];
if
(
is_callable
([
$e
,
"getPath"
])
)
{
if
(
is_callable
([
$e
,
"getPath"
])
)
{
//自建异常类处理path
$data
[
'path'
]
=
json_decode
(
$e
->
getPath
(),
true
);
}
else
{
//系统异常统一报500错误
$data
[
'code'
]
=
500
;
}
//获取调用堆栈信息
...
...
src/Common/Exception/ExceptionParseData.php
View file @
3664dc3d
...
...
@@ -24,7 +24,7 @@ class ExceptionParseData
$data
[
'code'
]
=
500
;
$data
[
'errorCode'
]
=
-
1
;
$data
[
'file'
]
=
$e
->
getFile
()
.
' '
.
$e
->
getLine
();
$data
[
'path'
]
=
[
$e
->
getFile
()
.
' '
.
$e
->
getLine
()];
$data
[
'path'
]
=
[
'Service:'
.
APP_NAME
.
$e
->
getFile
()
.
' '
.
$e
->
getLine
()];
}
return
$data
;
...
...
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