Add SMS ID to MalformedSms error
parent
52c9a13ca0
commit
c842211e75
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue