Module: Bugsnag::Api::Client::Errors
- Included in:
- Bugsnag::Api::Client
- Defined in:
- lib/bugsnag/api/client/errors.rb
Overview
Methods for the Errors API
Instance Method Summary collapse
-
#delete_errors(project_id, error_id = nil, options = {}) ⇒ Object
Delete an Error.
-
#errors(project_id, id = nil, options = {}) ⇒ Array<Sawyer::Resource>
(also: #error)
List the Errors on a Project.
-
#update_errors(project_id, ids, operation, options = {}) ⇒ Sawyer::Resource
Update an Error.
Instance Method Details
#delete_errors(project_id, error_id = nil, options = {}) ⇒ Object
Delete an Error
60 61 62 63 64 65 66 |
# File 'lib/bugsnag/api/client/errors.rb', line 60 def delete_errors(project_id, error_id=nil, = {}) if !error_id.nil? boolean_from_response :delete, "projects/#{project_id}/errors/#{error_id}", else boolean_from_response :delete, "projects/#{project_id}/errors", end end |
#errors(project_id, id = nil, options = {}) ⇒ Array<Sawyer::Resource> Also known as: error
List the Errors on a Project
19 20 21 22 23 24 25 |
# File 'lib/bugsnag/api/client/errors.rb', line 19 def errors(project_id, id=nil, = {}) if id.nil? paginate "projects/#{project_id}/errors", else get "projects/#{project_id}/errors/#{id}", end end |
#update_errors(project_id, ids, operation, options = {}) ⇒ Sawyer::Resource
Update an Error
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/bugsnag/api/client/errors.rb', line 40 def update_errors(project_id, ids, operation, = {}) case ids when String patch "projects/#{project_id}/errors/#{ids}", .merge({:operation => operation}) when Array defaults = {:operation => operation, :query => {:error_ids => ids.join(' ')}} merged_opts = deep_merge(defaults, ) patch "projects/#{project_id}/errors", merged_opts else raise ArgumentError, "ids must be a String or an Array" end end |