Skip to content
  • Kyle M Hall's avatar
    Bug 36307: SMS::Send driver errors are not captured and stored · 8acdc1e8
    Kyle M Hall authored and Katrin Fischer's avatar Katrin Fischer committed
    
    
    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: default avatarDavid Nind <david@davidnind.com>
    
    Signed-off-by: default avatarMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
    Signed-off-by: default avatarKatrin Fischer <katrin.fischer@bsz-bw.de>
    8acdc1e8