prawn-cake / vk-requests

vk.com requests for humans. API library for vk.com
MIT License
158 stars 22 forks source link

Add __repr__() method to VkAPIError #36

Closed cyber-chuvash closed 5 years ago

cyber-chuvash commented 5 years ago

Update VkAPIError so that the repr() call on it returns a useful string with all of the attributes instead of the useless "VkAPIError()"

prawn-cake commented 5 years ago

Thanks for the improvement. Could you provide an example what kind of output do you expect to get from it?

cyber-chuvash commented 5 years ago

Something like:

"VkAPIError(error_code=10, message='Internal server error', request_params={'oauth': '1', 'method': 'messages.send', 'v': '5.92', 'random_id': '0', 'peer_id': '2000000007'})"

This implementation would actually yield such string, but without whitespaces between parameters, because it would require either changing the __str__() method, which I used to fill in the parameters, or duplicating most of the __str__() code

prawn-cake commented 5 years ago

Okay. That looks good to me.