Handling payload bigger than 10KB
yarcub opened this issue ยท 1 comments
Hi ๐
I'm trying to handle failure calls to trigger
due to message exceeding 10KB. From my understanding REST API will respond with a 413
HTTP status code but this library doesn't expose it.
- the status is not exposed on the trigger returned value
- neither as a specific error
pusher-http-ruby/lib/pusher/request.rb
Lines 83 to 100 in 86e613f
It raises an unknown error with the message Unknown error (status code 413): #{body}
Imo, it's a know error (payload too big) and now the only way we can correctly handle/report it is by checking if the message for (status code 413)
which seems far from ideal.
What are you thoughts on this? Should it raise a more specific error?
Iโm really sorry for such a delay in getting back to you and thanks for submitting an issue. This issue was fixed in the latest versions of the library: https://github.com/pusher/pusher-http-ruby/blob/master/lib/pusher/request.rb#L83-L100, therefore Iโm going to close it.