public function test() { try { parent::test(); } catch (StorageInvalidException $e) { // check if it needs to be removed $this->checkStorageAvailability(); throw $e; } catch (StorageNotAvailableException $e) { // check if it needs to be removed or just temp unavailable $this->checkStorageAvailability(); throw $e; } }