Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ldy
/
phwoolcon
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f85b3e0c
authored
Sep 15, 2022
by
yeran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
1 parent
5fda5a9b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
composer.json
src/Router.php
composer.json
View file @
f85b3e0
...
...
@@ -3,7 +3,7 @@
"description"
:
"Phalcon"
,
"keywords"
:
[
"phwoolcon"
],
"type"
:
"library"
,
"version"
:
"1.0.1
0
"
,
"version"
:
"1.0.1
1
"
,
"license"
:
"proprietary"
,
"authors"
:
[
{
...
...
src/Router.php
View file @
f85b3e0
...
...
@@ -248,6 +248,10 @@ class Router extends PhalconRouter implements ServiceAwareInterface
return
$e
->
toResponse
();
//return static::$runningUnitTest ? $e : $e->toResponse();
}
catch
(
\Exception
$exception
)
{
$uuid
=
md5
(
uniqid
(
md5
(
microtime
(
true
)),
true
));
$exceptionMessage
=
$exception
->
getMessage
()
.
'---'
.
"['ERRORID:'
{
$uuid
}
]"
;
debug
(
'[Exception] File:['
.
$exception
->
getFile
()
.
'] '
.
'Line:['
.
$exception
->
getLine
()
.
'] '
.
'Message:['
.
$exceptionMessage
.
'] '
,
'ERROR'
);
//捕获异常
$response
=
new
Response
();
//获取响应实例
//判断是否为API异常
...
...
@@ -262,7 +266,8 @@ class Router extends PhalconRouter implements ServiceAwareInterface
}
$response
->
setContent
(
$exception
->
getBody
());
//设置响应内容
}
else
{
return
self
::
exceptionResponse
(
$response
,
$exception
->
getMessage
());
$errorMessage
=
"系统繁忙[ERRORID:
{
$uuid
}
]"
;
return
self
::
exceptionResponse
(
$response
,
$errorMessage
);
}
return
$response
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment