You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that when a request is made without proper authentication, the processing of the 401 response causes an exception.
There is a message attribute expected within the response which will be read into api_message. But the json response does not contain a message attribute. So api_message will be set to nil. https://github.com/mailgun/mailgun-ruby/blob/master/lib/mailgun/exceptions/exceptions.rb#L53
Expected behavior
To have a Mailgun::CommunicationError raised.
Actual behavior
A TypeError is raised.
How to reproduce
To reproduce, do the following: irb> Mailgun::Client.new('key-invalid').delete('my-random-domain/bounces/[email protected]')
/Users/eric/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/mailgun-ruby-1.2.10/lib/mailgun/exceptions/exceptions.rb:63:in `+': no implicit conversion of nil into String (TypeError)
message = message + ': ' + api_message
^^^^^^^^^^^
Environment
ruby: 3.2.2
mailgun: 1.2.10
rails: 7.0.7.2
The text was updated successfully, but these errors were encountered:
Hello
I have noticed that when a request is made without proper authentication, the processing of the 401 response causes an exception.
There is a
message
attribute expected within the response which will be read intoapi_message
. But the json response does not contain amessage
attribute. Soapi_message
will be set tonil
.https://github.com/mailgun/mailgun-ruby/blob/master/lib/mailgun/exceptions/exceptions.rb#L53
Expected behavior
To have a
Mailgun::CommunicationError
raised.Actual behavior
A TypeError is raised.
How to reproduce
To reproduce, do the following:
irb> Mailgun::Client.new('key-invalid').delete('my-random-domain/bounces/[email protected]')
Environment
ruby: 3.2.2
mailgun: 1.2.10
rails: 7.0.7.2
The text was updated successfully, but these errors were encountered: