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

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, 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

#errors(project_id, id = nil, options = {}) ⇒ Array<Sawyer::Resource> Also known as: error

List the Errors on a Project

Parameters:

  • base (Hash)

    a customizable set of options

  • sort (Hash)

    a customizable set of options

  • direction (Hash)

    a customizable set of options

  • filters (Hash)

    a customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    List of Project Errors

See Also:



19
20
21
22
23
24
25
# 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

#update_errors(project_id, ids, operation, options = {}) ⇒ Sawyer::Resource

Update an Error

Parameters:

  • severity (Hash)

    a customizable set of options

  • assigned_collaborator_id (Hash)

    a customizable set of options

  • issue_url (Hash)

    a customizable set of options

  • issue_title (Hash)

    a customizable set of options

  • reopen_rules (Hash)

    a customizable set of options

Returns:

  • (Sawyer::Resource)

    Updated Error

See Also:



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, 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