Exception: VisionAPI::TaskFailedError
- Defined in:
- lib/vision_api/errors.rb
Overview
An async task came back failed. A failed task costs 0 credits.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
Instance Method Summary collapse
-
#initialize(task_id, error) ⇒ TaskFailedError
constructor
A new instance of TaskFailedError.
Constructor Details
#initialize(task_id, error) ⇒ TaskFailedError
Returns a new instance of TaskFailedError.
136 137 138 139 140 141 142 |
# File 'lib/vision_api/errors.rb', line 136 def initialize(task_id, error) error ||= {} @task_id = task_id @code = error["code"] || "unknown" @details = error["details"] || {} super("Task #{task_id} failed — #{@code}: #{error["message"] || "no detail"}") end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
134 135 136 |
# File 'lib/vision_api/errors.rb', line 134 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
134 135 136 |
# File 'lib/vision_api/errors.rb', line 134 def details @details end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
134 135 136 |
# File 'lib/vision_api/errors.rb', line 134 def task_id @task_id end |