module Bugsnag::Api::Client::Errors

Methods for the Errors API

@see docs.bugsnagapiv2.apiary.io/#reference/errors

Public Instance Methods

delete_errors(project_id, error_id=nil, options = {}) click to toggle source

Delete an Error

@argument error_id [String] ID of error to delete (conflicts with project_id) @argument project_id [String] Id of project to delete all errors from (conflicts with error_id)

@return @see docs.bugsnagapiv2.apiary.io/#reference/errors/errors/delete-an-error

# File lib/bugsnag/api/client/errors.rb, line 60
def delete_errors(project_id, error_id=nil, options = {})
  if !error_id.nil?
    boolean_from_response :delete, "projects/#{project_id}/errors/#{error_id}", options
  else
    boolean_from_response :delete, "projects/#{project_id}/errors", options
  end
end
error(project_id, id=nil, options = {})
Alias for: errors
errors(project_id, id=nil, options = {}) click to toggle source

List the Errors on a Project

@argument id [String] optional ID of error to retrieve

@option base [String] Only Error Events occuring before this time will be returned @option sort [String] Which field to sort by, one of: last_seen, first_seen, users, events, unsorted @option direction [String] Which direction to sort the result by, one of: asc, desc @option filters [Filters] An optional filters object, see docs.bugsnagapiv2.apiary.io/#introduction/filtering @return [Array<Sawyer::Resource>] List of Project Errors @see docs.bugsnagapiv2.apiary.io/#reference/errors/errors/list-the-errors-on-a-project

# File lib/bugsnag/api/client/errors.rb, line 19
def errors(project_id, id=nil, options = {})
  if id.nil?
    paginate "projects/#{project_id}/errors", options
  else
    get "projects/#{project_id}/errors/#{id}", options
  end
end
Also aliased as: error
update_errors(project_id, ids, operation, options = {}) click to toggle source

Update an Error

@argument ids [(Array<String>/String)] An Id, or array of Ids to update

@option severity [String] The Error’s new severity. One of: info, warning, error @option assigned_collaborator_id [String] THe collaborator to assign to the Error @option issue_url [String] Updates to link to an existing 3rd party issue @option issue_title [String] Updates the issues title @option reopen_rules [Object] Snooze rules for automatically reopening the Error @return [Sawyer::Resource] Updated Error @see docs.bugsnagapiv2.apiary.io/#reference/errors/errors/update-an-error

# File lib/bugsnag/api/client/errors.rb, line 40
def update_errors(project_id, ids, operation, options = {})
  case ids
  when String
    patch "projects/#{project_id}/errors/#{ids}", options.merge({:operation => operation})
  when Array
    defaults = {:operation => operation, :query => {:error_ids => ids.join(' ')}}
    merged_opts = deep_merge(defaults, options)
    patch "projects/#{project_id}/errors", merged_opts
  else
    raise ArgumentError, "ids must be a String or an Array"
  end
end