Skip to content

Commit 4f2cbfa

Browse files
committed
AC-746: Malformed request body or parameters cause Internal Server Error
1 parent cf6ecb2 commit 4f2cbfa

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

dev/tests/api-functional/testsuite/Magento/Framework/Webapi/ApiErrorProcessorTest.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,6 @@ public function testMalformedRequestParams(array $requestData, string $endpoint,
6969
public static function malformedRequestParamsDataProvider()
7070
{
7171
return [
72-
'empty_filter_groups_field' => [
73-
'requestData' => [
74-
'searchCriteria' => [
75-
'filterGroups' => [
76-
[
77-
'filters' => [
78-
[
79-
'value' => 'string'
80-
]
81-
]
82-
]
83-
]
84-
]
85-
],
86-
'endpoint' => 'eav/attribute-sets/list',
87-
'expectedExceptionCode' => 400,
88-
],
8972
'empty_filter_groups_value' => [
9073
'requestData' => [
9174
'searchCriteria' => [
@@ -103,23 +86,6 @@ public static function malformedRequestParamsDataProvider()
10386
'endpoint' => 'coupons/search',
10487
'expectedExceptionCode' => 400,
10588
],
106-
'empty_filter_groups_field2' => [
107-
'requestData' => [
108-
'searchCriteria' => [
109-
'filterGroups' => [
110-
[
111-
'filters' => [
112-
[
113-
'value' => 'string'
114-
]
115-
]
116-
]
117-
]
118-
]
119-
],
120-
'endpoint' => 'cmsBlock/search',
121-
'expectedExceptionCode' => 400,
122-
],
12389
'empty_filter_groups_value2' => [
12490
'requestData' => [
12591
'searchCriteria' => [

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ private function getClientErrorHttpCode(\Exception $exception)
179179
{
180180
// Check if this is a client error based on the exception type
181181
if ($exception instanceof \Zend_Db_Exception
182-
|| $exception instanceof \Exception
183182
|| $exception instanceof \Zend_Db_Adapter_Exception
184183
|| $exception instanceof \Zend_Db_Statement_Exception
185184
|| $exception instanceof \PDOException

0 commit comments

Comments
 (0)