Class: BugsnagSourcemapUploader::UploadTask::Result
- Inherits:
-
Object
- Object
- BugsnagSourcemapUploader::UploadTask::Result
- Defined in:
- lib/bugsnag_sourcemap_uploader/upload_task.rb
Overview
Represents the result of the UploadTask#upload method.
Constant Summary collapse
- HTTP_TIMEOUT_CODE =
HTTP status code for timeouts
408
- HTTP_TOO_MANY_REQUESTS_CODE =
HTTP status code for too many requests
429
Instance Attribute Summary collapse
-
#asset_metadata ⇒ Object
readonly
Returns the value of attribute asset_metadata.
Instance Method Summary collapse
- #execution_error? ⇒ Boolean
- #failure? ⇒ Boolean
-
#initialize(asset_metadata, http_response) ⇒ Result
constructor
A new instance of Result.
- #reason ⇒ Object
- #retryable? ⇒ Boolean
- #status_code ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(asset_metadata, http_response) ⇒ Result
Returns a new instance of Result.
52 53 54 55 |
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 52 def initialize(, http_response) @asset_metadata = @http_response = http_response end |
Instance Attribute Details
#asset_metadata ⇒ Object (readonly)
Returns the value of attribute asset_metadata.
50 51 52 |
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 50 def @asset_metadata end |
Instance Method Details
#execution_error? ⇒ Boolean
73 74 75 |
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 73 def execution_error? false end |
#failure? ⇒ Boolean
69 70 71 |
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 69 def failure? !success? end |
#reason ⇒ Object
57 58 59 |
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 57 def reason @http_response.body end |
#retryable? ⇒ Boolean
77 78 79 80 81 |
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 77 def retryable? status_code < 400 || status_code > 499 || [HTTP_TIMEOUT_CODE, HTTP_TOO_MANY_REQUESTS_CODE].include?(status_code) end |
#status_code ⇒ Object
61 62 63 |
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 61 def status_code @http_response.code end |
#success? ⇒ Boolean
65 66 67 |
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 65 def success? @http_response.success? end |