mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
FIX ensure controller stack is updated when execution halted by an exception.
See: https://github.com/silverstripe/silverstripe-framework/issues/2467 popCurrent would be incorrectly not pop a controller from the controller stack if an exception was throw from inside the handleRequest() method. This change captures the exception, ensures the controller is popped from the stack and passes the exception along.
This commit is contained in:
parent
a1286f1c0f
commit
a777266e43
@ -193,8 +193,18 @@ class ContentController extends Controller {
|
||||
}
|
||||
|
||||
Director::set_current_page($this->data());
|
||||
$response = parent::handleRequest($request, $model);
|
||||
Director::set_current_page(null);
|
||||
|
||||
try {
|
||||
$response = parent::handleRequest($request, $model);
|
||||
|
||||
Director::set_current_page(null);
|
||||
} catch(SS_HTTPResponse_Exception $e) {
|
||||
$this->popCurrent();
|
||||
|
||||
Director::set_current_page(null);
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
Loading…
Reference in New Issue
Block a user