Robert Vogel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405299 )

Change subject: Fix "Error code 0" issue
......................................................................

Fix "Error code 0" issue

In some cases the returned code is integer "0". Adding the message to the
errors-array then collieds with this index.

Change-Id: I42ba94963208c749c8e82c68c121bbc3271b44ac
---
M includes/api/BSApiTasksBase.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/99/405299/1

diff --git a/includes/api/BSApiTasksBase.php b/includes/api/BSApiTasksBase.php
index 4cfd37a..93e8be5 100644
--- a/includes/api/BSApiTasksBase.php
+++ b/includes/api/BSApiTasksBase.php
@@ -158,6 +158,9 @@
                                                if( $e instanceof DBError ) {
                                                        $mCode = 'dberror'; 
//TODO: error code for subtypes like DBQueryError or DBReadOnlyError?
                                                }
+                                               if ( $mCode === 0 ) {
+                                                       $mCode = 'error-0';
+                                               }
                                                $oResult->errors[$mCode] = 
$e->getMessage();
                                                $oResult->errors[0]['code'] = 
'unknown error';
                                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/405299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42ba94963208c749c8e82c68c121bbc3271b44ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <vo...@hallowelt.biz>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to