Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error always logged on sync complete #17

Closed
bzbetty opened this issue Nov 8, 2015 · 7 comments
Closed

Error always logged on sync complete #17

bzbetty opened this issue Nov 8, 2015 · 7 comments

Comments

@bzbetty
Copy link

bzbetty commented Nov 8, 2015

We get a an error logged each sync with the message

[QBError] Out - {KEY} Sync Completed

trying to find out if there actually an error occuring that we need to fix, or if this should be an informational message instead of an error.

@jsgoupil
Copy link
Owner

jsgoupil commented Nov 8, 2015

@bzbetty Sorry but this seems to be your code logic? Is this coming from your LogMessage ?

@bzbetty
Copy link
Author

bzbetty commented Nov 8, 2015

I'm looking at line 406 of the Sync Manager

result = "Sync Completed";

@jsgoupil
Copy link
Owner

jsgoupil commented Nov 8, 2015

I'm not sure what the problem is? LogMessage does not mean an error happened. LogMessage is called for anything going in or out the API.

@bzbetty
Copy link
Author

bzbetty commented Nov 8, 2015

The LogMessage is called with LogMessageType.Error, just means every completion is coming up in my logs as an error and not an info/debug message.

LogMessage(authenticatedTicket, LogMessageType.Error, LogDirection.Out, ticket, result);

@jsgoupil
Copy link
Owner

jsgoupil commented Nov 8, 2015

Ah you are right. I misread that... sorry! It should definitely not be logged as an error. Thanks for pointing this out!

@jsgoupil
Copy link
Owner

jsgoupil commented Nov 8, 2015

I think this would fix it:

try
{
    LogMessage(authenticatedTicket, LogMessageType.Close, LogDirection.In, ticket);

    var logMessageType = LogMessageType.Error;
    var result = "Invalid Ticket";

    if (authenticatedTicket != null)
    {
        result = "Sync Completed";
        logMessageType = LogMessageType.Close;
    }

    LogMessage(authenticatedTicket, logMessageType, LogDirection.Out, ticket, result);

    return result;
}

@bzbetty
Copy link
Author

bzbetty commented Nov 8, 2015

yeah that looks much better. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants