Example #1
0
 /**
  * @param \Exception $exception
  *
  * @return self
  */
 public static final function createFromException(\Exception $exception)
 {
     if ($exception instanceof Exception\ApiProblemExceptionInterface) {
         return $exception->getApiProblem();
     }
     return self::createFromScalar(500, 'Unexpected error');
 }