[Bug 26555] New: Add a way for Koha::Object(s) to carry errors information
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Bug ID: 26555 Summary: Add a way for Koha::Object(s) to carry errors information Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org I propose we add an ->errors method that returns a list of Koha::Object::Error objects. They would be added by using ->add_error($params). This way we can pass , for example, non-fatal error information to the caller. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26515 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26515 [Bug 26515] Add Koha::Acquisition::Order->cancel -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 110854 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110854&action=edit Bug 26555: Add Koha::Object::Error This patch introduces a tiny class for encapsulating errors in Koha::Object derived classes. To test: 1. Apply this patch 2. Run; $ kshell k$ prove t/Koha/Object/Error.t => SUCCESS: Tests pass! 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 110855 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110855&action=edit Bug 26555: Add ->errors and ->add_error to Koha::Object This patch adds a way to make Koha::Object-derived classes to carry errors around. This targets non-fatal errors that need to be notified to the caller, to avoid complex exception handling on the controllers when it is not expected to be fatal. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t => SUCCESS: Tests pass! 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|ASSIGNED |In Discussion --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Should we call it 'messages' to make it more general? Jonathan pointed that this situation could be confusing: $o->bad_call $o->errors; # error is set $o->good_call $o->errors; # error is still set Setting 'In discussion' with the hope to get some feedback. I think this pattern is something we would like to make use of. Or we could return $self, { something => else }; instead of crafting this into Koha::Object. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm in favour of such a standardised way of adding operational feedback for non-fatal errors/information passing. We introduced such a use case in the Koha::Item trigger for when lost items are marked as found. Having a standardised approach to passing such information around in the object would be great.. I've already found a few more cases for such feedback and it allows for continued moves toward fluent (chainable) interfaces. Perhaps 'messages' is the best name for this as we already have exceptions for fatal errors, and I can see where Jonathan is coming from with your comment Tomas. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add a way for |Add a way for |Koha::Object(s) to carry |Koha::Object(s) to carry |errors information |execution information -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110854|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110855|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 110911 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110911&action=edit Bug 26555: Add Koha::Object::Message This patch introduces a tiny class for encapsulating execution messages in Koha::Object derived classes. To test: 1. Apply this patch 2. Run; $ kshell k$ prove t/Koha/Object/Message.t => SUCCESS: Tests pass! 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 110912 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110912&action=edit Bug 26555: Add ->messages and ->add_message to Koha::Object This patch adds a way to make Koha::Object-derived classes to carry messages around. This targets non-fatal errors, or around action flags for the caller, to avoid complex exception handling on the controllers when it is not expected to be fatal. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t => SUCCESS: Tests pass! 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 110913 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110913&action=edit Bug 26555: (QA follow-up) Add ->reset_messages -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110911|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 110957 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110957&action=edit Bug 26555: Add Koha::Object::Message This patch introduces a tiny class for encapsulating execution messages in Koha::Object derived classes. To test: 1. Apply this patch 2. Run; $ kshell k$ prove t/Koha/Object/Message.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110912|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 110958 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110958&action=edit Bug 26555: Add ->messages and ->add_message to Koha::Object This patch adds a way to make Koha::Object-derived classes to carry messages around. This targets non-fatal errors, or around action flags for the caller, to avoid complex exception handling on the controllers when it is not expected to be fatal. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110913|0 |1 is obsolete| | --- Comment #10 from David Nind <david@davidnind.com> --- Created attachment 110959 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110959&action=edit Bug 26555: (QA follow-up) Add ->reset_messages Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110957|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 110967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110967&action=edit Bug 26555: Add Koha::Object::Message This patch introduces a tiny class for encapsulating execution messages in Koha::Object derived classes. To test: 1. Apply this patch 2. Run; $ kshell k$ prove t/Koha/Object/Message.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110958|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 110968 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110968&action=edit Bug 26555: Add ->messages and ->add_message to Koha::Object This patch adds a way to make Koha::Object-derived classes to carry messages around. This targets non-fatal errors, or around action flags for the caller, to avoid complex exception handling on the controllers when it is not expected to be fatal. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110959|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 110969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110969&action=edit Bug 26555: (QA follow-up) Add ->reset_messages Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I really like this implementation. It works well and gives us a nice way to pass messages around inside our object system without throwing fatal exceptions for non-fatal actions. Works well, contains tests. Passing QA - Nice one Tomas! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 110983 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110983&action=edit Bug 26555: Make sure _messages is always initialized Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Tomas, I am not a fan of this, and I am wondering if the following approach would not be better. Imagine you have one or more messages (ie. not blocking errors) to pass to the caller, then you could throw a Koha::Exception::Messages (or Koha::Exception::Errors?) that would contain a set of Koha::Exception. That would allow us to tell the callers several things happened, and let it handle the situation how it wants. What do you think? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #16)
Tomas, I am not a fan of this, and I am wondering if the following approach would not be better.
I need to explain that this was just my attempt to find a more elegant way of doing this: https://gitlab.com/koha-community/Koha/-/blob/master/Koha/Item.pm#L886 i.e. passing execution information to the caller, while keeping chainability on the methods. That was the only example I found in which we did something similar-ish. I renamed them from Koha::Object::Error to Koha::Object::Message as well, for that reason.
Imagine you have one or more messages (ie. not blocking errors) to pass to the caller, then you could throw a Koha::Exception::Messages (or Koha::Exception::Errors?) that would contain a set of Koha::Exception. That would allow us to tell the callers several things happened, and let it handle the situation how it wants.
What do you think?
I prefer exceptions as well. But how would that look in the code? My implementation means you need to catch error conditions in your sub, and add error messages to notify. Then you just return normally. And is up to the caller to do something with those errors/messages. basket.pl and closeorder.pl don't care much about them, they will, but I intended not to change behaviour yet. With your proposal, you would need to accumulate the messages (maybe reusing this ->add_message method) and at the end of the method, check if there are messages, and throw an exception. It is not mutually exclusive with this implementation, actually. It is just a matter of how you want to do/use it. Take the basket.pl example. It doesn't bother to notify errors (I'm not implying that's correct, but you could want that). Do you really want to enforce a try/catch block for catching the error messages? And what if there are other exceptions? try { $object->the_method; } catch { if ( ref($->isa) eq 'Koha::Object::Messages' ) { $check_errors = 1; } elsif ( ref($_) eq 'Koha::Exception::XXX' ) { HANDLE_ERROR(); } else { UNHANDLED_EXCEPTION(); } }; NORMAL_EXECUTION({ check_errors => $check_errors }) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #16)
Tomas, I am not a fan of this, and I am wondering if the following approach would not be better.
Imagine you have one or more messages (ie. not blocking errors) to pass to the caller, then you could throw a Koha::Exception::Messages (or Koha::Exception::Errors?) that would contain a set of Koha::Exception. That would allow us to tell the callers several things happened, and let it handle the situation how it wants.
What do you think?
If you think we have time to have it in master for the next release, I can work on removing this generic thing from Koha::Object and only keep the message encapsulating class (Koha::Object::Message), and introduce a Koha::Exception::Object::Messages exception that carries a list of Koha::Object::Message objects. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26651 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26651 [Bug 26651] Add Koha::Object->reset_messages -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110968|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110969|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110983|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110967|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 111426 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111426&action=edit Bug 26555: Add Koha::Object::Message This patch introduces a tiny class for encapsulating execution messages in Koha::Object derived classes. To test: 1. Apply this patch 2. Run; $ kshell k$ prove t/Koha/Object/Message.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 111427 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111427&action=edit Bug 26555: Add ->messages and ->add_message to Koha::Object This patch adds a way to make Koha::Object-derived classes to carry messages around. This targets non-fatal errors, or around action flags for the caller, to avoid complex exception handling on the controllers when it is not expected to be fatal. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 111428 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111428&action=edit Bug 26555: Make sure _messages is always initialized Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26652 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26652 [Bug 26652] Add a way to mark messages as 'seen' in Koha::Object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agustinmoyano@theke.io, | |joonas.kylmala@helsinki.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #3)
Jonathan pointed that this situation could be confusing:
$o->bad_call $o->errors; # error is set $o->good_call $o->errors; # error is still set
What did we do here now? Nothing yet. Should we clear the array on calling ->errors ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #22)
(In reply to Tomás Cohen Arazi from comment #3)
Jonathan pointed that this situation could be confusing:
$o->bad_call $o->errors; # error is set $o->good_call $o->errors; # error is still set
What did we do here now? Nothing yet. Should we clear the array on calling ->errors ?
Then: $o->bad_call $o->good_call $o->errors; # error is set! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #23)
(In reply to Marcel de Rooy from comment #22)
(In reply to Tomás Cohen Arazi from comment #3)
Jonathan pointed that this situation could be confusing:
$o->bad_call $o->errors; # error is set $o->good_call $o->errors; # error is still set
What did we do here now? Nothing yet. Should we clear the array on calling ->errors ?
Then: $o->bad_call $o->good_call $o->errors; # error is set!
It's no longer 'errors' but 'messages'; We're not trying to catch "errors" but rather convey informational messages down the stack. For hard-stop errors we should continue to throw exceptions. I don't think we should reset the 'messages' content personally.. you can always grab a fresh object if you wish to do so. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #25 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Please look at the in discussion follow-ups. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #26 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 111723 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111723&action=edit Bug 26555: (QA follow-up) Add a 'payload' attribute for carrying useful things Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 --- Comment #28 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Super excited by this one :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26704 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26704 [Bug 26704] Koha::Item store triggers should utilise Koha::Object::Messages for message passing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement adds a release notes| |standardised way to pass | |execution information | |around within | |Koha::Objects. | | | |Execution | |data should be set by | |action methods calling | |`$self->add_message({ | |message => $message, type | |=> $type, payload => | |$payload });` inside the | |action method. | | | |The caller | |can then access the | |execution data using `my | |$messages = | |$object->messages;` -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26555 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #29 from Lucas Gass <lucas@bywatersolutions.com> --- enhancement will not be backported to 20.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org