Open jrouaix opened 3 years ago
That's an interesting idea. PR's welcome! You should be able to implement this with a PR that changes only goose.rs
. Otherwise I'll try and circle back to this, as I agree it would be useful when using Goose as a library.
How/where would you consume these errors? While it's easy enough to add a custom error type, I'm not sure where you'd receive and handle it?
Currently Transaction functions are invoked here: https://github.com/tag1consulting/goose/blob/main/src/user.rs#L278
We could improve that logic to bubble up the error to the parent function, which would be here: https://github.com/tag1consulting/goose/blob/main/src/user.rs#L71
But at that point we can't bubble it up any further. So, @jrouaix, @dpc what would your goal/use-case be?
The current design would recommend you use set_failure() as that would get all information into the debug log. https://docs.rs/goose/latest/goose/goose/struct.GooseUser.html#method.set_failure
My goal would be for goose to bubble these errors all the way to the report (aggregate) and tell me that N transactions failed on valuation errors.
Hello,
I'm trying to implement a full story scenario in a goose task. Not sure it's the way to do that, but it allows me to reuse generated data from the server or fake data from Faker; I'd like to ensure the responses are correct, and fail in a nice way (no panic) when it does. Right now, i'm using
assert!
macros but i'd like to do better and use the goose machinery instead.Could we imagine having a
GooseTaskResult::Custom()
?