From eda6d10ce5ac0aebb6f41b4d47a5470178ca0c69 Mon Sep 17 00:00:00 2001 From: Pascal Precht <445106+PascalPrecht@users.noreply.github.com> Date: Fri, 5 Aug 2022 10:36:32 +0200 Subject: [PATCH] fix: adjust error codes for discord import There are two types of errors "non-critical" (or "warning") and "critical". These map to error codes `1` and `2` respectively. The current error codes are a left-over of initial experimenting. --- protocol/messenger_communities.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol/messenger_communities.go b/protocol/messenger_communities.go index 79443ce09..ee50771b9 100644 --- a/protocol/messenger_communities.go +++ b/protocol/messenger_communities.go @@ -1801,7 +1801,7 @@ func (m *Messenger) ExtractDiscordDataFromImportFiles(filesToImport []string) (* bytes, err := os.ReadFile(filePath) if err != nil { errors[fileToImport] = &discord.ImportError{ - Code: 201, + Code: 2, Message: err.Error(), } continue @@ -1812,7 +1812,7 @@ func (m *Messenger) ExtractDiscordDataFromImportFiles(filesToImport []string) (* err = json.Unmarshal(bytes, &discordExportedData) if err != nil { errors[fileToImport] = &discord.ImportError{ - Code: 202, + Code: 2, Message: err.Error(), } continue @@ -1820,7 +1820,7 @@ func (m *Messenger) ExtractDiscordDataFromImportFiles(filesToImport []string) (* if len(discordExportedData.Messages) == 0 { errors[fileToImport] = &discord.ImportError{ - Code: 203, + Code: 2, Message: "No messages to import", } continue