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>
pull/36115/head
Côme Chilliet 3 years ago
parent d389b54e2a
commit 4edb96080d
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 10
      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;
}

Loading…
Cancel
Save