Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-rpc
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-rpc
Commits
062185e8
Commit
062185e8
authored
Mar 18, 2020
by
王源
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加异常处理配置
parent
85801d31
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
ConfigProvider.php
src/ConfigProvider.php
+14
-0
MicroExceptionHandler.php
src/Exceptions/Handler/MicroExceptionHandler.php
+0
-1
No files found.
src/ConfigProvider.php
View file @
062185e8
...
@@ -15,10 +15,24 @@ class ConfigProvider
...
@@ -15,10 +15,24 @@ class ConfigProvider
public
function
__invoke
()
:
array
public
function
__invoke
()
:
array
{
{
return
[
return
[
'exceptions'
=>
[
'handler'
=>
[
'http'
=>
[
\Meibuyu\Micro\Exceptions\Handler\MicroExceptionHandler
::
class
,
],
],
],
'commands'
=>
[
'commands'
=>
[
\Meibuyu\Micro\Command\RepositoryCommand
::
class
,
\Meibuyu\Micro\Command\RepositoryCommand
::
class
,
\Meibuyu\Micro\Command\ValidatorCommand
::
class
,
\Meibuyu\Micro\Command\ValidatorCommand
::
class
,
],
],
'annotations'
=>
[
'scan'
=>
[
'paths'
=>
[
__DIR__
,
],
],
],
];
];
}
}
...
...
src/Exceptions/Handler/MicroExceptionHandler.php
View file @
062185e8
...
@@ -20,7 +20,6 @@ use Throwable;
...
@@ -20,7 +20,6 @@ use Throwable;
class
MicroExceptionHandler
extends
ExceptionHandler
class
MicroExceptionHandler
extends
ExceptionHandler
{
{
public
function
handle
(
Throwable
$throwable
,
ResponseInterface
$response
)
public
function
handle
(
Throwable
$throwable
,
ResponseInterface
$response
)
{
{
// 判断被捕获到的异常是希望被捕获的异常
// 判断被捕获到的异常是希望被捕获的异常
...
...
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