Fix GetErrorCode in ItemEventCallbacks

Cast int to string to retrieve proper error code which is Unknown Error.
This commit is contained in:
Valens
2025-01-25 13:36:25 -05:00
parent 8ab23cf6f4
commit dd52283d0d
@@ -48,9 +48,9 @@ public class ItemEventCallbacks(HttpResponseUtil _httpResponseUtil, ItemEventRou
public int GetErrorCode(List<Warning> warnings)
{
// TODO: dont think this actually works
// Cast int to string to get the error code of 220 for Unknown Error.
return int.Parse((warnings[0].Code is null || warnings[0].Code == "None"
? (BackendErrorCodes.UnknownError).ToString()
? ((int) BackendErrorCodes.UnknownError).ToString()
: warnings.FirstOrDefault()?.Code) ?? string.Empty);
}
}