File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 33namespace  SumoCoders \FrameworkCoreBundle \EventListener ;
44
55use  Doctrine \ORM \EntityManagerInterface ;
6+ use  SumoCoders \FrameworkCoreBundle \Exception \Breadcrumb \EntityNotFoundException ;
67use  SumoCoders \FrameworkCoreBundle \ValueObject \Route ;
78use  Symfony \Bridge \Doctrine \Attribute \MapEntity ;
89use  Symfony \Component \PropertyAccess \PropertyAccessorInterface ;
@@ -95,12 +96,16 @@ private function processAttributeFromMethod(
9596                $ this addBreadcrumbsForParent ($ attributeInstancegetParent ());
9697            }
9798
98-             $ this breadcrumbTrail ->add (
99-                 $ this generateBreadcrumb (
100-                     $ attributeInstance
101-                     $ method
102-                 )
103-             );
99+             try  {
100+                 $ this breadcrumbTrail ->add (
101+                     $ this generateBreadcrumb (
102+                         $ attributeInstance
103+                         $ method
104+                     )
105+                 );
106+             } catch  (EntityNotFoundException $ e
107+ 
108+             }
104109        }
105110    }
106111
@@ -159,7 +164,7 @@ private function generateBreadcrumb(
159164            }
160165
161166            if  (!is_object ($ attribute
162-                 throw  new  RuntimeException (
167+                 throw  new  EntityNotFoundException (
163168                    'Could not resolve entity  '  . $ name' with ID  '  . $ attributeId
164169                );
165170            }
Original file line number Diff line number Diff line change 1+ <?php 
2+ 
3+ namespace  SumoCoders \FrameworkCoreBundle \Exception \Breadcrumb ;
4+ 
5+ final  class  EntityNotFoundException extends  \RuntimeException
6+ {
7+ }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments