Re: how to debug, not understanding safe_primitive

Torbjörn Lager <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CA+Y3JZi6mUNjEKaiLoWvDFLinR568kUS+9H5QSihvUaQYtbRaA@mail.gmail.com>
For debugging, a good idea in general is to define the onerror handler, like so:

        <script>
            var pengine = new Pengine({
                oncreate: handleCreate,
                onsuccess: handleSuccess,
                onerror: handleSuccess         % <= here, borrowing
handleSuccess...
            });
            function handleCreate () {
                pengine.ask("q(X)", {
                    template:'X'
                });
            }
            function handleSuccess() {
                $('#out').html(this.data);
            }
        </script>

The at least you should be able to see the error. Don't think that
will catch a 500 error though. We may have to do something in the
JavaScript client code for that.

Best regards,
Torbjörn

On Fri, Feb 7, 2014 at 3:28 AM, Anne Ogborn <[email protected]> wrote:
> ok, found the issue,  need to call taco in the right module, but this still
> leaves questions
>
> p(X),pengine_server:taco(X).
>
> Any suggestions for something besides enlightenment to debug pengines code?
>
>



-- 
Torbjörn Lager
Professor of General and Computational Linguistics
Department of Philosophy, Linguistics and Theory of Science
University of Gothenburg
Box 200, SE-405 30 Gothenburg, Sweden
Phone: +46317864962
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.