Paws X (Well not XXX)

I had my response from my question up in github.

If I am remembering correctly we are throwing an exception because at some point in time AWS has returned invalid XML on non-200 responses (the test suite tries to covers more cases). The error message was too cryptic when invalid XML came in, so we started to throw a Paws::Exception that at least gives you an indication of what went on.

Hmm ok so the test case might be valid though I do not see how that is a problem for Paws if AWS is returning invalid XML.

Taking a peek about at what else does a 'throw' vs a 'new' Paws::Exception I found that all of the classes in 'lib/Paws/Net' that have a 'unserialize_response' sub use 'throw' vs 'new' except for one 'Paws::Net::RestXMLResponse'

All of the subs should work the same way, or at least I think they should. So that means that that sub in 'Paws::Net::RestXMLResponse' is in error or at least not working the same as the other interfaces.

It sounds like I have to look into this.

However, one of the rules doing patches and fixes is never try to do too much at once. Much better to get one thing fixed and working than then get one fixed three half fixed and a few newly broken.

So I better get back on track, by rolling back that change in 'Paws::Net::XMLResponse' and make a metal note to come back to this in a future post.

So back to my original patch. I was still getting an error on the ' t/14_dns_client_errors.t' test case and after much gnashing of teeth I tracked it back to a mix up between the Mojolicious installed on my box and the one that was installed by Paws builder in the 'local/lib/perl5' dir so I got that one working by flipping a few ENV var about.

So to quickly recap on the code changes that I have made.

  • templates/EC2/callresult_class.tt
  • templates/default/class_documentation.tt
  • templates/json/callresult_class.tt
  • templates/query/callresult_class.tt
  • templates/restjson/callresult_class.tt
  • templates/restxml/callresult_class.tt
I added in the '_status' attribute so it will come out in the auto generated classes
  • lib/Paws/Net/RestXMLResponse.pm

fixed how the message and code attributes are set.

Added in the status from the response to the new '_status' attribute that is now in the generated classes.

  • lib/Paws/Exception.pm

added in the 'host_id' attribute as it was being passed as a new param but there was no place to store it

  • t/10_responses/*
  • t/11_client_exceptions.t

added in tests for the new attributes from above.

Fixed the odd test to return the correct expected results.


So now I think I can push this up and see what the Paws gurus think about it.

However I just noticed that one of my other questions was answered so I better check that before I commit anything.

58409113_136925650760916_3192507087110640529_n.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations