Add SMS ID to MalformedSms error

develop
Guillaume DOTT 2014-02-10 11:15:13 +01:00
parent 52c9a13ca0
commit c842211e75
2 changed files with 4 additions and 3 deletions

View File

@ -105,7 +105,7 @@ module Biju
begin begin
Biju::Sms.from_pdu(msg[:message].chomp, msg[:infos][0]) Biju::Sms.from_pdu(msg[:message].chomp, msg[:infos][0])
rescue Biju::PDU::Errors::PDUError => e 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 if exceptions
raise malformed raise malformed
else else

View File

@ -6,9 +6,10 @@ module Biju
class MalformedSms < PDUError class MalformedSms < PDUError
attr_reader :original_exception 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 @pdu = pdu
@original_exception = original_exception @original_exception = original_exception
end end