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
7d553abf
Commit
7d553abf
authored
Jul 11, 2018
by
王召彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
2c8ed64f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
src/Common/Exception/BaseException.php
+43
-0
src/Shop/Lib/TestInterface.php
+1
-2
No files found.
src/Common/Exception/BaseException.php
0 → 100644
View file @
7d553abf
<?php
namespace
Hdll\Services\Common\Exception
;
use
Swoft\Exception\Exception
;
class
BaseException
extends
Exception
{
// HTTP 状态码 404,200
public
$code
=
500
;
// 错误具体信息
public
$message
=
'服务器异常'
;
// 业务错误码
public
$errorCode
=
-
1
;
public
function
__construct
(
$params
)
{
if
(
!
is_array
(
$params
)){
return
;
throw
new
Exception
(
'参数必须是数组'
);
}
if
(
array_key_exists
(
'code'
,
$params
)){
$this
->
code
=
$params
[
'errorCode'
];
}
if
(
array_key_exists
(
'msg'
,
$params
)){
$this
->
message
=
$params
[
'msg'
];
}
if
(
array_key_exists
(
'errorCode'
,
$params
)){
$this
->
errorCode
=
$params
[
'errorCode'
];
}
parent
::
__construct
(
$this
->
message
,
$this
->
code
);
}
public
function
getErrcode
(){
return
$this
->
errorCode
;
}
}
\ No newline at end of file
src/Shop/Lib/TestInterface.php
View file @
7d553abf
...
@@ -10,4 +10,4 @@ interface TestInterface
...
@@ -10,4 +10,4 @@ interface TestInterface
* @return void
* @return void
*/
*/
public
function
testRpc
(
string
$var
);
public
function
testRpc
(
string
$var
);
}
}
\ No newline at end of file
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