File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
src/Bridge/Symfony/Bundle/DependencyInjection
tests/Bridge/Symfony/Bundle/DependencyInjection Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 15
15
16
16
use ApiPlatform \Core \Exception \FilterValidationException ;
17
17
use ApiPlatform \Core \Exception \InvalidArgumentException ;
18
+ use Doctrine \ORM \OptimisticLockException ;
18
19
use FOS \UserBundle \FOSUserBundle ;
19
20
use GraphQL \GraphQL ;
20
21
use Symfony \Bundle \TwigBundle \TwigBundle ;
@@ -263,6 +264,7 @@ private function addExceptionToStatusSection(ArrayNodeDefinition $rootNode)
263
264
ExceptionInterface::class => Response::HTTP_BAD_REQUEST ,
264
265
InvalidArgumentException::class => Response::HTTP_BAD_REQUEST ,
265
266
FilterValidationException::class => Response::HTTP_BAD_REQUEST ,
267
+ OptimisticLockException::class => Response::HTTP_CONFLICT ,
266
268
])
267
269
->info ('The list of exceptions mapped to their HTTP status code. ' )
268
270
->normalizeKeys (false )
Original file line number Diff line number Diff line change 40
40
use ApiPlatform \Core \Tests \Fixtures \TestBundle \TestBundle ;
41
41
use ApiPlatform \Core \Validator \ValidatorInterface ;
42
42
use Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
43
+ use Doctrine \ORM \OptimisticLockException ;
43
44
use FOS \UserBundle \FOSUserBundle ;
44
45
use Nelmio \ApiDocBundle \NelmioApiDocBundle ;
45
46
use PHPUnit \Framework \TestCase ;
@@ -487,6 +488,7 @@ private function getPartialContainerBuilderProphecy($test = false)
487
488
ExceptionInterface::class => Response::HTTP_BAD_REQUEST ,
488
489
InvalidArgumentException::class => Response::HTTP_BAD_REQUEST ,
489
490
FilterValidationException::class => Response::HTTP_BAD_REQUEST ,
491
+ OptimisticLockException::class => Response::HTTP_CONFLICT ,
490
492
],
491
493
'api_platform.title ' => 'title ' ,
492
494
'api_platform.version ' => 'version ' ,
Original file line number Diff line number Diff line change 16
16
use ApiPlatform \Core \Bridge \Symfony \Bundle \DependencyInjection \Configuration ;
17
17
use ApiPlatform \Core \Exception \FilterValidationException ;
18
18
use ApiPlatform \Core \Exception \InvalidArgumentException ;
19
+ use Doctrine \ORM \OptimisticLockException ;
19
20
use PHPUnit \Framework \TestCase ;
20
21
use Symfony \Component \Config \Definition \Builder \TreeBuilder ;
21
22
use Symfony \Component \Config \Definition \ConfigurationInterface ;
@@ -72,6 +73,7 @@ public function testDefaultConfig()
72
73
ExceptionInterface::class => Response::HTTP_BAD_REQUEST ,
73
74
InvalidArgumentException::class => Response::HTTP_BAD_REQUEST ,
74
75
FilterValidationException::class => Response::HTTP_BAD_REQUEST ,
76
+ OptimisticLockException::class => Response::HTTP_CONFLICT ,
75
77
],
76
78
'default_operation_path_resolver ' => 'api_platform.operation_path_resolver.underscore ' ,
77
79
'path_segment_name_generator ' => 'api_platform.path_segment_name_generator.underscore ' ,
You can’t perform that action at this time.
0 commit comments