Class: X::MediaProcessingTimeout
- Inherits:
-
Uploader::Error
- Object
- Error
- Uploader::Error
- X::MediaProcessingTimeout
- Defined in:
- x-uploader/lib/x/uploader/media_processing_timeout.rb
Overview
Error raised when uploaded media is still processing after the time await_processing may wait
Instance Attribute Summary collapse
-
#media ⇒ UploadedMedia?
readonly
The uploaded media, as the last processing status X reported describes it.
-
#timeout ⇒ Integer, ...
readonly
The seconds await_processing was allowed to wait.
Instance Method Summary collapse
-
#initialize(message = nil, media: nil, timeout: nil) ⇒ MediaProcessingTimeout
constructor
Initialize the error with the last status and the time that was allowed.
Constructor Details
#initialize(message = nil, media: nil, timeout: nil) ⇒ MediaProcessingTimeout
Initialize the error with the last status and the time that was allowed
The message is the one given, or else names the time that was allowed, when one was given.
49 50 51 52 53 |
# File 'x-uploader/lib/x/uploader/media_processing_timeout.rb', line 49 def initialize( = nil, media: nil, timeout: nil) @media = media.is_a?(Hash) ? UploadedMedia.new(media) : media @timeout = timeout super( || (timeout ? format(WITHIN_TIMEOUT, timeout) : "Media processing did not finish")) end |
Instance Attribute Details
#media ⇒ UploadedMedia? (readonly)
The uploaded media, as the last processing status X reported describes it
Its processing_info holds the state and progress of the processing.
26 27 28 |
# File 'x-uploader/lib/x/uploader/media_processing_timeout.rb', line 26 def media @media end |
#timeout ⇒ Integer, ... (readonly)
The seconds await_processing was allowed to wait
33 34 35 |
# File 'x-uploader/lib/x/uploader/media_processing_timeout.rb', line 33 def timeout @timeout end |