summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2022-04-13 10:58:41 -0700
committerGitHub <noreply@github.com>2022-04-13 10:58:41 -0700
commit3ebf7d045a518894e24b8cb7cbad1a01fb6fe158 (patch)
tree1aa927fdab76ac77f264eedff5a7901b51ccca46 /apps
parent58f5de08dfe7796e61754adf7f618ea6d48ef343 (diff)
parent0924271abe084870ee3c51dd3de0fae46b06a8cc (diff)
downloadnextcloud-server-3ebf7d045a518894e24b8cb7cbad1a01fb6fe158.tar.gz
nextcloud-server-3ebf7d045a518894e24b8cb7cbad1a01fb6fe158.zip
Merge pull request #31969 from nextcloud/fix/user_migration-use-exceptions
Catch avatar export separately for better failure tracing
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/UserMigration/AccountMigrator.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/settings/lib/UserMigration/AccountMigrator.php b/apps/settings/lib/UserMigration/AccountMigrator.php
index 32cf898f2bc..7b60a101cee 100644
--- a/apps/settings/lib/UserMigration/AccountMigrator.php
+++ b/apps/settings/lib/UserMigration/AccountMigrator.php
@@ -77,7 +77,11 @@ class AccountMigrator implements IMigrator {
try {
$account = $this->accountManager->getAccount($user);
$exportDestination->addFileContents(AccountMigrator::PATH_ACCOUNT_FILE, json_encode($account));
+ } catch (Throwable $e) {
+ throw new AccountMigratorException('Could not export account information', 0, $e);
+ }
+ try {
$avatar = $this->avatarManager->getAvatar($user->getUID());
if ($avatar->isCustomAvatar()) {
$avatarFile = $avatar->getFile(-1);
@@ -87,7 +91,7 @@ class AccountMigrator implements IMigrator {
$exportDestination->addFileAsStream($exportPath, $avatarFile->read());
}
} catch (Throwable $e) {
- throw new AccountMigratorException('Could not export account information', 0, $e);
+ throw new AccountMigratorException('Could not export avatar', 0, $e);
}
}