]> source.dussan.org Git - nextcloud-server.git/commitdiff
Catch avatar export separately for better failure tracing 31969/head
authorChristopher Ng <chrng8@gmail.com>
Wed, 13 Apr 2022 17:02:25 +0000 (17:02 +0000)
committerChristopher Ng <chrng8@gmail.com>
Wed, 13 Apr 2022 17:02:25 +0000 (17:02 +0000)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
apps/settings/lib/UserMigration/AccountMigrator.php

index 32cf898f2bc551a7611cde00e31f6ae4d596b5eb..7b60a101ceeb9a6b2527e99de417621c629413b4 100644 (file)
@@ -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);
                }
        }