diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-01-12 12:01:21 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-01-12 12:01:21 +0100 |
commit | 4edb96080ded280cbcf47cca84f8f133278f6bb1 (patch) | |
tree | de4cd08c9b26d2927a0fcc5cb8df9ded221863b2 /apps/provisioning_api | |
parent | d389b54e2ade596982a6055afb9db515219b44ae (diff) | |
download | nextcloud-server-4edb96080ded280cbcf47cca84f8f133278f6bb1.tar.gz nextcloud-server-4edb96080ded280cbcf47cca84f8f133278f6bb1.zip |
Catch Exceptions when loading storage data of users
This avoids having the whole userlist crashing because a user external
storage fails to load. With this change only the problematic user
storage/quota information will be empty.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r-- | apps/provisioning_api/lib/Controller/AUserData.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php index 668b86c059a..e9855eebe91 100644 --- a/apps/provisioning_api/lib/Controller/AUserData.php +++ b/apps/provisioning_api/lib/Controller/AUserData.php @@ -268,6 +268,16 @@ abstract class AUserData extends OCSController { self::USER_FIELD_QUOTA => $quota !== false ? $quota : 'none', 'used' => 0 ]; + } catch (\Exception $e) { + \OC::$server->get(\Psr\Log\LoggerInterface::class)->error( + "Could not load storage info for {user}", + [ + 'app' => 'provisioning_api', + 'user' => $userId, + 'exception' => $e, + ] + ); + return []; } return $data; } |