owncloud-serv/lib/private/appframework/middleware/middlewaredispatcher.php
/**
	 * This is being run when either the beforeController method or the
	 * controller method itself is throwing an exception. The middleware is asked
	 * in reverse order to handle the exception and to return a response.
	 * If the response is null, it is assumed that the exception could not be
	 * handled and the error will be thrown again
	 *
	 * @param Controller $controller the controller that is being called
	 * @param string $methodName the name of the method that will be called on
	 *                            the controller
	 * @param \Exception $exception the thrown exception
	 * @return Response a Response object if the middleware can handle the
	 * exception
	 * @throws \Exception the passed in exception if it cant handle it
	 */
This is being run when either the beforeController method or the
controller method itself is throwing an exception. The middleware is asked
in reverse order to handle the exception and to return a response.
If the response is null, it is assumed that the exception could not be
handled and the error will be thrown again


This is being run when either the beforeController method or the controller method itself is throwing an exception . The middleware is asked in reverse order to handle the exception and to return a response . If the response is null it is assumed that the exception could not be handled and the error will be thrown again
public function afterException(Controller $controller, $methodName, \Exception $exception){
		for($i=$this->middlewareCounter-1; $i>=0; $i--){
			$middleware = $this->middlewares[$i];
			try {
				return $middleware->afterException($controller, $methodName, $exception);
			} catch(\Exception $exception){
				continue;
			}
		}
		throw $exception;
	}
public function afterException ( Controller $ controller , $ methodName , \ Exception $ exception ) { for ( $ i = $ this -> middlewareCounter - 1 ; $ i >= 0 ; $ i -- ) { $ middleware = $ this -> middlewares [ $ i ] ; try { return $ middleware -> afterException ( $ controller , $ methodName , $ exception ) ; } catch ( \ Exception $ exception ) { continue ; } } throw $ exception ; }
This is being run when either the beforeController method or the
 controller method itself is throwing an exception.
This is being run when either the beforeController method or the controller method itself is throwing an exception .