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

Calling LRS .saveStatement with an object but not a TinCan.Statement doesn't cause error #74

Open
brianjmiller opened this issue Jun 12, 2014 · 2 comments
Labels

Comments

@brianjmiller
Copy link
Member

Need to investigate but the following didn't result in an error in the callback:

lrs.saveStatement(
    {
        actor: {
            mbox: "[email protected]"
        }
    },
    {
        callback: function (err) {
            console.log("Priming statement sent");
            if (err !== null) {
                console.log("Priming statement failed: ", err);
                process.exit(1);
            }

            // getting here and shouldn't
        }
    }
);
@FishHooks
Copy link
Contributor

@brianjmiller would it make sense to try constructing a TinCan.Statement object from the object passed, or should we be strict on this and only accept TinCan.Statement objects?

@brianjmiller
Copy link
Member Author

Actually I now suspect this is because of the dumb default of allowFail. Unfortunately didn't record how the TinCan.LRS object was constructed, but it makes sense that there wouldn't be an error in the callback if allowFail is set to true (which is the dumb default, one of the items on the roadmap #110). Though in this case perhaps even for allowFail set to true we could fail because it isn't the communication with the LRS that is failing, it is an improper use of the library.

I've thought about auto-constructing a statement object, but I don't know that there is a reason to change it for this issue, the larger problem was that even in that case it should still fail.

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

No branches or pull requests

2 participants