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.
This commit is contained in:
parent
cd91b19737
commit
eda6d10ce5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue