Class: X::MediaProcessingCheckFailed
- Inherits:
-
Uploader::Error
- Object
- Error
- Uploader::Error
- X::MediaProcessingCheckFailed
- Defined in:
- x-uploader/lib/x/uploader/media_processing_check_failed.rb
Overview
Error raised when media is uploaded, but a check of its processing fails
An upload awaits the processing of media X processes, such as a video, once the media is uploaded, and billed, so the media is not lost to a check that fails, as one the API answers with a server error, or one the on_response hook of the client raises: the error holds the media, which can be awaited again with await_processing. The error that failed the check is the cause, whose message the message ends with.
Instance Attribute Summary collapse
-
#media ⇒ UploadedMedia?
readonly
The media that was uploaded, as the upload response describes it.
Instance Method Summary collapse
-
#initialize(message = nil, media: nil) ⇒ MediaProcessingCheckFailed
constructor
Initialize the error with the media that was uploaded.
-
#to_s ⇒ String
The message, ending with why the processing could not be checked.
Constructor Details
#initialize(message = nil, media: nil) ⇒ MediaProcessingCheckFailed
Initialize the error with the media that was uploaded
The message is the one given, or else names the media by its identifier, when media that holds one was given.
65 66 67 68 |
# File 'x-uploader/lib/x/uploader/media_processing_check_failed.rb', line 65 def initialize( = nil, media: nil) @media = media.is_a?(Hash) ? UploadedMedia.new(media) : media super( || ["Media", media&.[]("id"), "was uploaded, but its processing could not be checked"].compact.join(" ")) end |
Instance Attribute Details
#media ⇒ UploadedMedia? (readonly)
The media that was uploaded, as the upload response describes it
50 51 52 |
# File 'x-uploader/lib/x/uploader/media_processing_check_failed.rb', line 50 def media @media end |
Instance Method Details
#to_s ⇒ String
The message, ending with why the processing could not be checked
It ends with the message of the error that failed the check, which is the cause, if there is one, whether the message was given or named the media.
79 |
# File 'x-uploader/lib/x/uploader/media_processing_check_failed.rb', line 79 def to_s = [super, cause&.].compact.join(": ") |