Handle invalid storage when getting storage root id#29210
Handle invalid storage when getting storage root id#29210DeepDiver1975 merged 1 commit intomasterfrom
Conversation
| return (int)$this->getStorage()->getCache()->getId(''); | ||
| $storage = $this->getStorage(); | ||
| if ($storage !== null && !$this->invalidStorage) { | ||
| return (int)$storage->getCache()->getId(''); |
7e9f8c5 to
9e9c96c
Compare
|
@DeepDiver1975 I've adjusted it: now it also checks if the cache is null. As a bonus, I also added unit tests and squashed. |
There was a problem hiding this comment.
Is it worthy to provide different value to mark different errors, such as -1 = storage not found, -2 invalid = storage? Use constants?
There was a problem hiding this comment.
not at this point... this method is only called in one location currently and doesn't care what the error is about
There was a problem hiding this comment.
Ok, fair enough.
Could you add the information in the PHPDoc? Otherwise -1 would be a valid storage id that wouldn't need special handling.
There was a problem hiding this comment.
I've now adjusted the PHPDoc and also the one from IMountPoint to mention the -1 value
9e9c96c to
e75950e
Compare
|
stable10: #29278 |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Whenever an invalid storage is present like a remote storage with invalid certificate, the mount point handling code will fail hard because the storage could not be instantiated.
Steps here: #28763 (comment)
Analysis here: #28763 (comment)
Related Issue
#28763
Motivation and Context
How Has This Been Tested?
See steps
Screenshots (if appropriate):
Types of changes
Checklist: