Uh oh!
There was an error while loading. Please reload this page.
Add catch for RuntimeException - #15606
Conversation
getDirectoryListing can throw a NotFoundException or a RuntimeException. The repair step should be skipped if the cache directory is missing so a catch for both exceptions is required. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
kesselb
commented
May 17, 2019
The user reported that the repair step was failing even with this patch but fixed his problem by settings the right permissions for appdata_xxx. Nevertheless we should catch the exception here and/or show the user a proper warning if appdata is not writeable. |
| try { | ||
| $folders = $this->appData->getDirectoryListing(); | ||
| } catch (NotFoundException $e) { | ||
| } catch (NotFoundException|RuntimeException $e) { |
There was a problem hiding this comment.
Problem with this is that this is now not logged anymore 🙈
There was a problem hiding this comment.
Yep. Please catch is separataly and log it for easier debugging
There was a problem hiding this comment.
I'm not against it but that looks like the wrong place. If the permissions for appdata are broken we should prevent the upgrade and show a warning. Doing this inside a repair job sounds wrong to me.
There was a problem hiding this comment.
Still it should be logged. Let me add it.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
MorrisJobke
commented
Jul 15, 2019
/backport to stable16 |
backport to stable16 in #16414 |
Fix#15605
getDirectoryListing can throw a NotFoundException or a RuntimeException.
The repair step should be skipped if the cache directory is missing so
a catch for both exceptions is required.
How to reproduce:
occ files:scan-app-data