agents swallowing exceptions?
hello, it seems like when i'm running agent stuff via load-file etc. in the repl, exceptions in fns the agent runs don't appear to be logged anywhere, they are seemingly silently swallowed. personally i find that frustrating. is there some way to make them always verbose / spit out to stdout? or am i just crazy and they are showing up and i just don't see them? :} many thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: agents swallowing exceptions?
If any exceptions are thrown by an action function, no nested dispatches will occur, and the exception will be cached in the Agent itself. When an Agent has errors cached, any subsequent interactions will immediately throw an exception, until the agent's errors are cleared. Agent errors can be examined with agent-errors and cleared with clear-agent-errors. -- http://clojure.org/agents On Mon, Oct 19, 2009 at 3:41 PM, Raoul Duke rao...@gmail.com wrote: hello, it seems like when i'm running agent stuff via load-file etc. in the repl, exceptions in fns the agent runs don't appear to be logged anywhere, they are seemingly silently swallowed. personally i find that frustrating. is there some way to make them always verbose / spit out to stdout? or am i just crazy and they are showing up and i just don't see them? :} many thanks. -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: agents swallowing exceptions?
If any exceptions are thrown by an action function, no nested dispatches will occur, and the exception will be cached in the Agent itself. When an Agent has errors cached, any subsequent interactions will immediately throw an exception, until the agent's errors are cleared. Agent errors can be examined with agent-errors and cleared with clear-agent-errors. apparently one has to manually write ones agents to log the exceptions out to stderr or stdout? i guess my personal principle of least surprise implementation would have been to at least spit out the first exception once. sincerely. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: agents swallowing exceptions?
Raoul Duke wrote: apparently one has to manually write ones agents to log the exceptions out to stderr or stdout? i guess my personal principle of least surprise implementation would have been to at least spit out the first exception once. The problem is where do you throw the exceptions? Due to the asynchronous nature of agents the thread that called send/senf-off is potentially long gone and is doing something else now. So the agent can't safely immediately throw it. Perhaps you're suggesting the agents should automatically catch all their own exceptions and then throw them to stderr. What if you want to handle them? For debugging I guess you can define your own version of send/send-off that wraps methods in a try/catch. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: agents swallowing exceptions?
i don't know what the best solution for everybody is, but the super silent treatment seems like the worst, but that's just me :-} Perhaps you're suggesting the agents should automatically catch all their own exceptions and then throw them to stderr. What if you want to handle them? For debugging I guess you can define your own version of send/send-off that wraps methods in a try/catch. yup, i gathered similarly; sounds like what i should do! thanks all. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---