You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in the ExecuteResponse we check if the main required object is present. But when there is an error, it ends up to be an ugly if case for each status error code.
Example with InvoiceAdd
if (response.InvoiceRet != null) { ... }
else if (response.statusCode == "3120") {
}
Not only this is ugly, but when the response is coming back with an error, there are no state saved properly with what has been sent and what is being returned.
So I end up doing either a save to the database or something ugly like:
// If the object cannot be added, it's because the parent has been deleted.
////"Object "80000027-1429563689" specified in the request cannot be found. QuickBooks error message: Invalid argument. The specified record does not exist in the list."
var startsWith = "Object \"";
var endsWith = "\" specified in the request cannot be found. QuickBooks error message: Invalid argument. The specified record does not exist in the list.";
if (response.statusMessage.StartsWith(startsWith) && response.statusMessage.EndsWith(endsWith))
{
// We will remove the entity sync, we can't sync this invoice. We will also remove the site.
var invoiceIdStr = messageService.RetrieveMessage(authenticatedTicket.Ticket, GetName(), Key);
int invoiceId = 0;
if (invoiceIdStr != null && int.TryParse(invoiceIdStr, out invoiceId))
{
The text was updated successfully, but these errors were encountered:
Currently, in the ExecuteResponse we check if the main required object is present. But when there is an error, it ends up to be an ugly if case for each status error code.
Example with InvoiceAdd
Not only this is ugly, but when the response is coming back with an error, there are no state saved properly with what has been sent and what is being returned.
So I end up doing either a save to the database or something ugly like:
The text was updated successfully, but these errors were encountered: