Ejemplo n.º 1
0
 /**
  * Set the proper Error Handler based on the Output of the page
  *
  * @param OutputData $output
  */
 public function setHandler($output)
 {
     $this->_whoops->popHandler();
     if ($output == OutputData::Json) {
         $this->_handler = new JsonResponseHandler();
     } else {
         if ($output == OutputData::Xml) {
             $this->_handler = new XmlResponseHandler();
         } else {
             $this->_handler = new PrettyPageHandler();
             if (!Context::getInstance()->getDevelopmentStatus()) {
                 $this->_handler->addResourcePath(\WhoopsResources\Resource::getPath());
             }
         }
     }
     $this->_whoops->pushHandler($this->_handler);
 }