Skip to content

Commit 4978cab

Browse files
author
Yuri Kovsher
committed
MAGETWO-34991: Eliminate exceptions from the list Part2
1 parent 47de030 commit 4978cab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/internal/Magento/Framework/Webapi/ErrorProcessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ public function maskException(\Exception $exception)
100100
$isDevMode = $this->_appState->getMode() === State::MODE_DEVELOPER;
101101
$stackTrace = $isDevMode ? $exception->getTraceAsString() : null;
102102

103-
if ($exception instanceof LocalizedException) {
103+
if ($exception instanceof WebapiException) {
104+
$maskedException = $exception;
105+
} elseif ($exception instanceof LocalizedException) {
104106
// Map HTTP codes for LocalizedExceptions according to exception type
105107
if ($exception instanceof NoSuchEntityException) {
106108
$httpCode = WebapiException::HTTP_NOT_FOUND;
@@ -128,8 +130,6 @@ public function maskException(\Exception $exception)
128130
$errors,
129131
$stackTrace
130132
);
131-
} elseif ($exception instanceof WebapiException) {
132-
$maskedException = $exception;
133133
} else {
134134
$message = $exception->getMessage();
135135
$code = $exception->getCode();

lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function deserialize($xmlRequestBody)
8787
*/
8888
public function handleErrors($errorNumber, $errorMessage, $errorFile, $errorLine)
8989
{
90-
if (is_null($this->_errorMessage)) {
90+
if ($this->_errorMessage === null) {
9191
$this->_errorMessage = $errorMessage;
9292
} else {
9393
$this->_errorMessage .= $errorMessage;

0 commit comments

Comments
 (0)