As stated in this post, when sending media in chunk, at the FINALIZE step the status needs to be checked:
If and (only if) the response of the FINALIZE command contains a processing_info field, it may also be necessary to use a STATUS command and wait for it to return success before proceeding to Tweet creation.
If the media processing is not finished on Twitter side and we try to send a tweet using it, it'll fail with There was an error sending your message: Bad Media, unable to process: None..
This PR updates REST::UploadUtils#chunk_upload to handle those cases.
A special case was added to Twitter::REST::Request#error to handle media exceptions because Twitter returns a 200 in those cases. A new MediaError exception class was added with other specialized subclasses.
Hi,
As stated in this post, when sending media in chunk, at the FINALIZE step the status needs to be checked:
If the media processing is not finished on Twitter side and we try to send a tweet using it, it'll fail with
There was an error sending your message: Bad Media, unable to process: None.
.This PR updates
REST::UploadUtils#chunk_upload
to handle those cases. A special case was added toTwitter::REST::Request#error
to handle media exceptions because Twitter returns a200
in those cases. A newMediaError
exception class was added with other specialized subclasses.