From 41d193f7caf4bdbf07f7347c59c8dcc21b49227f Mon Sep 17 00:00:00 2001
From: Lee Rowlands <lee.rowlands@previousnext.com.au>
Date: Thu, 15 Feb 2024 09:45:32 +1000
Subject: [PATCH] Issue #3416798 by GafgarionMorua, arunkumark, larowlan,
 smustgrave, DamienMcKenna: Refactor the breadcrumb generation "catch" code

(cherry picked from commit 54f3e98a56bf4c41a4b092aa58438ff2b71ae628)
---
 .../system/src/PathBasedBreadcrumbBuilder.php      | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/core/modules/system/src/PathBasedBreadcrumbBuilder.php b/core/modules/system/src/PathBasedBreadcrumbBuilder.php
index 64985ed1ed92..749dad24f7c9 100644
--- a/core/modules/system/src/PathBasedBreadcrumbBuilder.php
+++ b/core/modules/system/src/PathBasedBreadcrumbBuilder.php
@@ -226,19 +226,7 @@ protected function getRequestForPath($path, array $exclude) {
       $request->attributes->add($this->router->matchRequest($request));
       return $request;
     }
-    catch (ParamNotConvertedException $e) {
-      return NULL;
-    }
-    catch (ResourceNotFoundException $e) {
-      return NULL;
-    }
-    catch (MethodNotAllowedException $e) {
-      return NULL;
-    }
-    catch (AccessDeniedHttpException $e) {
-      return NULL;
-    }
-    catch (NotFoundHttpException $e) {
+    catch (ParamNotConvertedException | ResourceNotFoundException | MethodNotAllowedException | AccessDeniedHttpException | NotFoundHttpException $e) {
       return NULL;
     }
   }
-- 
GitLab