fix(discord): always emit import error if it's of type error

We've been limiting the amount of errors being emitted to clients
to reduce payload pressure and also due to the fact that we won't be
rendering more than 3 error items in the UI.

We want to let actual errors through (as opposed to warnings), even if
the limit was reached.
This commit is contained in:
Pascal Precht 2022-11-04 08:04:48 +01:00 committed by r4bbit.eth
parent bfab85f73b
commit 8ad9fb7713
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ func (progress *ImportProgress) AddTaskError(task ImportTask, err *ImportError)
for i, t := range progress.Tasks {
if t.Type == task.String() {
errorsAndWarningsCount := progress.Tasks[i].ErrorsCount + progress.Tasks[i].WarningsCount
if errorsAndWarningsCount < MaxTaskErrorItemsCount {
if (errorsAndWarningsCount < MaxTaskErrorItemsCount) || err.Code > WarningType {
errors := progress.Tasks[i].Errors
progress.Tasks[i].Errors = append(errors, err)
}