[Bug 36307] New: SMS::Send driver errors are not captured and stored
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 Bug ID: 36307 Summary: SMS::Send driver errors are not captured and stored 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: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org If an SMS::Send driver succeeds, it returns a value that evaluates to true. Every driver I've inspected uses croak when it encounters a failure state. When an SMS message fails to send, code hard codes the failure code to NO_NOTES (No notes from SMS driver). We should store the real error in `failure_code` and display that if the failure code doesn't match a known failure code. -- 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=36307 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- 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=36307 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 163116 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163116&action=edit Bug 36307 - SMS::Send driver errors are not captured and stored If an SMS::Send driver succeeds, it returns a value that evaluates to true. Every driver I've inspected uses croak when it encounters a failure state. When an SMS message fails to send, code hard codes the failure code to NO_NOTES (No notes from SMS driver). We should store the real error in `failure_code` and display that if the failure code doesn't match a known failure code. Test Plan: 1) Apply this patch 2) Set SMSSendDriver to any value 3) Generate a pending sms message 4) Run the following query: update message_queue set status = 'failed', failure_code = "This is a test"; 5) View the patron's messages, note the delivery note contains the contents of the failure code 6) Run the following query: update message_queue set status = 'failed', failure_code = "SMS_SEND_DRIVER_MISSING"; 7) Reload the patron's messages, not the delivery note is now "The SMS driver could not be loaded". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrewfh@dubcolib.org --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- *** Bug 32381 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Just bumped into this yesterday so I understand better now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 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=36307 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163116|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 163156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163156&action=edit Bug 36307 - SMS::Send driver errors are not captured and stored If an SMS::Send driver succeeds, it returns a value that evaluates to true. Every driver I've inspected uses croak when it encounters a failure state. When an SMS message fails to send, code hard codes the failure code to NO_NOTES (No notes from SMS driver). We should store the real error in `failure_code` and display that if the failure code doesn't match a known failure code. Test Plan: 1) Apply this patch 2) Set SMSSendDriver to any value 3) Generate a pending sms message 4) Run the following query: update message_queue set status = 'failed', failure_code = "This is a test"; 5) View the patron's messages, note the delivery note contains the contents of the failure code 6) Run the following query: update message_queue set status = 'failed', failure_code = "SMS_SEND_DRIVER_MISSING"; 7) Reload the patron's messages, not the delivery note is now "The SMS driver could not be loaded". 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=36307 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 164463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164463&action=edit Bug 36307: SMS::Send driver errors are not captured and stored If an SMS::Send driver succeeds, it returns a value that evaluates to true. Every driver I've inspected uses croak when it encounters a failure state. When an SMS message fails to send, code hard codes the failure code to NO_NOTES (No notes from SMS driver). We should store the real error in `failure_code` and display that if the failure code doesn't match a known failure code. Test Plan: 1) Apply this patch 2) Set SMSSendDriver to any value 3) Generate a pending sms message 4) Run the following query: update message_queue set status = 'failed', failure_code = "This is a test"; 5) View the patron's messages, note the delivery note contains the contents of the failure code 6) Run the following query: update message_queue set status = 'failed', failure_code = "SMS_SEND_DRIVER_MISSING"; 7) Reload the patron's messages, not the delivery note is now "The SMS driver could not be loaded". Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <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=36307 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | CC| |m.de.rooy@rijksmuseum.nl --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FIXED * Commit title does not start with 'Bug XXXXX: ' - eb3ef09d69 Following code could still be improved with error codes. (No blocker for me) foreach my $required_parameter ( qw( message destination ) ) { # Should I warn in some way? return unless defined $params->{ $required_parameter }; } eval { require SMS::Send; }; if ( $@ ) { # we apparently don't have SMS::Send. Return a failure. return; } Similarly (no blocker for me): return $sent; If $sent is 0, this could use a specific error code, I would say. Now we fallback to NO_NOTES. SMS::Send does not tell us much more, I am afraid. Provide a follow-up if you like. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163156|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=36307 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.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=36307 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|24.05.00 |24.05.00,23.11.06 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #8 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36307 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to stable |RESOLVED Resolution|--- |FIXED --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- Doesn't apply cleanly to 23.05.x, no backport. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org