Class: BugsnagSourcemapUploader::UploadTask::Result

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_metadataObject (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

Returns:

  • (Boolean)


73
74
75
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 73

def execution_error?
  false
end

#failure?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 69

def failure?
  !success?
end

#reasonObject



57
58
59
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 57

def reason
  @http_response.body
end

#retryable?Boolean

Returns:

  • (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_codeObject



61
62
63
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 61

def status_code
  @http_response.code
end

#success?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/bugsnag_sourcemap_uploader/upload_task.rb', line 65

def success?
  @http_response.success?
end