diff --git a/lib/biju/hayes.rb b/lib/biju/hayes.rb index c5cc9e6..191954d 100644 --- a/lib/biju/hayes.rb +++ b/lib/biju/hayes.rb @@ -105,7 +105,7 @@ module Biju begin Biju::Sms.from_pdu(msg[:message].chomp, msg[:infos][0]) rescue Biju::PDU::Errors::PDUError => e - malformed = Biju::PDU::Errors::MalformedSms.new(msg[:message].chomp, e) + malformed = Biju::PDU::Errors::MalformedSms.new(msg[:message].chomp, msg[:infos][0], e) if exceptions raise malformed else diff --git a/lib/biju/pdu/errors.rb b/lib/biju/pdu/errors.rb index 37fe0cf..3824678 100644 --- a/lib/biju/pdu/errors.rb +++ b/lib/biju/pdu/errors.rb @@ -6,9 +6,10 @@ module Biju class MalformedSms < PDUError attr_reader :original_exception - attr_reader :pdu + attr_reader :pdu, :id - def initialize(pdu, original_exception = nil) + def initialize(pdu, id, original_exception = nil) + @id = id @pdu = pdu @original_exception = original_exception end