| 2013-03-07 01:48:35 utc | nightmann | is there a clean way to raise errors directly from the engine? |
| 2013-03-07 01:49:47 utc | nightmann | that is, not get trapped and put into a message during dispatch (apologies if the terminology or process is wrong) |
| 2013-03-07 01:49:52 utc | jmettraux | hello |
| 2013-03-07 01:51:00 utc | nightmann | hey |
| 2013-03-07 01:51:33 utc | nightmann | my current situation: writing process definition tests and would just like to know if there's an easier way |
| 2013-03-07 01:52:01 utc | jmettraux | the errors are raised in participant implementations? |
| 2013-03-07 01:52:16 utc | nightmann | so far i've come up with `wait_for(:or_error)["error"]`, but that's only after a test run that indicates an error has occurred |
| 2013-03-07 01:52:20 utc | nightmann | yeah |
| 2013-03-07 01:52:43 utc | nightmann | well, specifically, I'm using webmock, which is raising the exception |
| 2013-03-07 01:53:01 utc | jmettraux | iirc, you could raise an Exception (ie not a StandardError) and having it blast through it all |
| 2013-03-07 01:53:23 utc | jmettraux | not sure if that's what you want in production |
| 2013-03-07 01:53:48 utc | nightmann | in production, i think wrapping the errors in an exception works |
| 2013-03-07 01:54:10 utc | nightmann | in test, though, it would be very nice to have the exceptions raised without any rescue |
| 2013-03-07 01:55:10 utc | jmettraux | I don't agree |
| 2013-03-07 01:57:37 utc | nightmann | can you elaborate? |
| 2013-03-07 02:01:01 utc | jmettraux | exceptional behaviour will come bite you later |
| 2013-03-07 02:01:29 utc | jmettraux | you have the engine, you wait for termination or error, test or prod or dev doesn't matter |
| 2013-03-07 02:07:14 utc | nightmann | so then is the only way to retrieve an error by changing any wait_for(*args) to wait_for(:or_error) and then retrieve the error from that hash? |
| 2013-03-07 02:10:02 utc | jmettraux | wait_for(wfid) returns on flow termination or flow error |
| 2013-03-07 02:10:27 utc | jmettraux | you can retrieve the error from the process status (dashboard.ps(wfid)) |
| 2013-03-07 02:18:27 utc | nightmann | https://github.com/jmettraux/ruote/blob/master/lib/ruote/log/wait_logger.rb#L274 |
| 2013-03-07 02:18:46 utc | nightmann | interests there would always be empty based on https://github.com/jmettraux/ruote/blob/master/lib/ruote/log/wait_logger.rb#L230, right? |
| 2013-03-07 02:20:54 utc | jmettraux | I'm preparing my tax forms here, from afar I'd say, yes if :or_error is used, but do you need that :or_error? |
| 2013-03-07 02:21:39 utc | jmettraux | there is a timeout in those wait_for, if you don't want to wait to long for the timeout, you can pass a shorter time duration and let your wait_for timeout and your test fail |
| 2013-03-07 02:24:50 utc | nightmann | i played with the timeout earlier; though I'm trying to figure out why wait_for didn't return from flow error (or so it seemed) |
| 2013-03-07 02:26:51 utc | jmettraux | what does your wait_for look like? |
| 2013-03-07 02:30:24 utc | nightmann | just `wait_for(wfid)` |
| 2013-03-07 02:30:58 utc | nightmann | based on debug in "get_msg", the last action before it stalls (until the timeout) is dispatch |
| 2013-03-07 02:32:27 utc | jmettraux | what are the symptoms? |
| 2013-03-07 02:35:34 utc | nightmann | i added in the correct mocks to make the workflow complete without error |
| 2013-03-07 02:36:16 utc | nightmann | i then added in a `raise Exception` into one of the participants, and the wait_for times out, the last message's action being a dispatch |
| 2013-03-07 02:36:27 utc | nightmann | i'll try to write a test case for it on the train |
| 2013-03-07 02:36:33 utc | nightmann | bbl |
| 2013-03-07 03:44:48 utc | jmettraux | nightmann: hello, I cooked that: https://gist.github.com/anonymous/5105397 |
| 2013-03-07 03:45:33 utc | jmettraux | my "advice" to use raise Exception is effectively crap, the error is not intercepted, wait_for becomes ineffective |
| 2013-03-07 04:23:47 utc | nightmann | hmm ok |
| 2013-03-07 05:47:23 utc | nightmann | it seems like the error handling should take care of it |
| 2013-03-07 05:47:41 utc | nightmann | (well evidently not) |
| 2013-03-07 05:47:46 utc | nightmann | just looking through the source now |
| 2013-03-07 05:51:22 utc | jmettraux | sorry, I don't understand what you are talking about |
| 2013-03-07 05:52:01 utc | nightmann | i mean, just trying to trace the flow of the raised exception to find out what is happening to it |
| 2013-03-07 21:10:12 utc | jmettraux | chongyu123: hello and welcome to #ruote |