lib/bugsnag/api/client/errors.rb in bugsnag-api-2.0.2 vs lib/bugsnag/api/client/errors.rb in bugsnag-api-2.0.3
- old
+ new
@@ -6,27 +6,27 @@
#
# @see http://docs.bugsnagapiv2.apiary.io/#reference/errors
module Errors
# 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 http://docs.bugsnagapiv2.apiary.io/#introduction/filtering
# @return [Array<Sawyer::Resource>] List of Project Errors
# @see http://docs.bugsnagapiv2.apiary.io/#reference/errors/errors/list-the-errors-on-a-project
def errors(project_id, id=nil, options = {})
- paginate "projects/#{project_id}/errors", options
+ if id.nil?
+ paginate "projects/#{project_id}/errors", options
+ else
+ get "projects/#{project_id}/errors/#{id}", options
+ end
end
- # View an Error
- #
- # @return [Sawyer::Resource] Requested Error
- # @see http://docs.bugsnagapiv2.apiary.io/#reference/errors/errors/view-an-error
- def error(project_id, id, options = {})
- get "projects/#{project_id}/errors/#{id}", options
- end
+ alias error errors
# Update an Error
#
# @argument ids [(Array<String>/String)] An Id, or array of Ids to update
#
@@ -53,11 +53,11 @@
# 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
+ # @return
# @see http://docs.bugsnagapiv2.apiary.io/#reference/errors/errors/delete-an-error
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
@@ -66,6 +66,5 @@
end
end
end
end
end
-
\ No newline at end of file