Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
civicrm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
plugins
civicrm
Commits
bc23b0ef
Verified
Commit
bc23b0ef
authored
Feb 04, 2020
by
Andrei Mondoc
Committed by
Kevin Cristiano
Mar 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accept instance of WP_Error
Signed-off-by:
Kevin Cristiano
<
kcristiano@kcristiano.com
>
parent
338cfc1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
wp-rest/Controller/Base.php
wp-rest/Controller/Base.php
+5
-1
No files found.
wp-rest/Controller/Base.php
View file @
bc23b0ef
...
...
@@ -88,7 +88,7 @@ abstract class Base extends \WP_REST_Controller implements Endpoint_Interface {
* Wrapper for WP_Error.
*
* @since 0.1
* @param string|\CiviCRM_API3_Exception $error
* @param string|\CiviCRM_API3_Exception
|\WP_Error
$error
* @param mixed $data Error data
* @return WP_Error $error
*/
...
...
@@ -98,6 +98,10 @@ abstract class Base extends \WP_REST_Controller implements Endpoint_Interface {
return
$error
->
getExtraParams
();
}
elseif
(
$error
instanceof
\
WP_Error
)
{
return
$error
;
}
return
new
\
WP_Error
(
'civicrm_rest_api_error'
,
$error
,
empty
(
$data
)
?
[
'status'
=>
$this
->
authorization_status_code
()
]
:
$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