original_string: protected function buildException(array $notFound)
      {
          $notFound += array('controllers' => array(), 'actions' => array());
  
          // All controllers and actions were not found, prepare exception message
          $message = 'The page you requested was not found';
          if ($this->wei->isDebug()) {
              $detail = $this->request->get('debug-detail');
              foreach ($notFound['controllers'] as $controller => $classes) {
                  $message .= sprintf('%s - controller "%s" not found', "\n", $controller);
                  $detail && $message .= sprintf(' (class "%s")', implode($classes, '", "'));
              }
              foreach ($notFound['actions'] as $action => $controllers) {
                  $method = $this->getActionMethod($action);
                  foreach ($controllers as $controller => $classes) {
                      $message .= sprintf('%s - method "%s" not found in controller "%s"', "\n", $method, $controller);
                      $detail && $message .= sprintf(' (class "%s")', implode($classes, '", "'));
                  }
              }
          }
  
          // You can use `$wei->error->notFound(function(){});` to custom the 404 page
          return new \RuntimeException($message, 404);
      }
code: protected function buildException(array $notFound)
      {
          $notFound += array('controllers' => array(), 'actions' => array());
  
          // All controllers and actions were not found, prepare exception message
          $message = 'The page you requested was not found';
          if ($this->wei->isDebug()) {
              $detail = $this->request->get('debug-detail');
              foreach ($notFound['controllers'] as $controller => $classes) {
                  $message .= sprintf('%s - controller "%s" not found', "\n", $controller);
                  $detail && $message .= sprintf(' (class "%s")', implode($classes, '", "'));
              }
              foreach ($notFound['actions'] as $action => $controllers) {
                  $method = $this->getActionMethod($action);
                  foreach ($controllers as $controller => $classes) {
                      $message .= sprintf('%s - method "%s" not found in controller "%s"', "\n", $method, $controller);
                      $detail && $message .= sprintf(' (class "%s")', implode($classes, '", "'));
                  }
              }
          }
  
          // You can use `$wei->error->notFound(function(){});` to custom the 404 page
          return new \RuntimeException($message, 404);
      }
code_tokens: protected function buildException ( array $ notFound ) { $ notFound += array ( 'controllers' => array ( ) , 'actions' => array ( ) ) ; // All controllers and actions were not found, prepare exception message $ message = 'The page you requested was not found' ; if ( $ this -> wei -> isDebug ( ) ) { $ detail = $ this -> request -> get ( 'debug-detail' ) ; foreach ( $ notFound [ 'controllers' ] as $ controller => $ classes ) { $ message .= sprintf ( '%s - controller "%s" not found' , "\n" , $ controller ) ; $ detail && $ message .= sprintf ( ' (class "%s")' , implode ( $ classes , '", "' ) ) ; } foreach ( $ notFound [ 'actions' ] as $ action => $ controllers ) { $ method = $ this -> getActionMethod ( $ action ) ; foreach ( $ controllers as $ controller => $ classes ) { $ message .= sprintf ( '%s - method "%s" not found in controller "%s"' , "\n" , $ method , $ controller ) ; $ detail && $ message .= sprintf ( ' (class "%s")' , implode ( $ classes , '", "' ) ) ; } } } // You can use `$wei->error->notFound(function(){});` to custom the 404 page return new \ RuntimeException ( $ message , 404 ) ; }
docstring: Build 404 exception from notFound array
  
  @param array $notFound
  @return \RuntimeException
docstring_tokens: Build 404 exception from notFound array