Sha256: c8ff6cff7df89d3528198547aa277a582ba48397464880a01432d1b14166bb28
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
module BacklogKit # Custom error class for rescuing from Backlog errors # # @see http://developer.nulab-inc.com/docs/backlog/error-response class Error < StandardError # Make a custom error message # # @param response [Hash] Error response # @param index [Integer] Index of the error # @return [String] Error message def self.build_error_message(response, index) message = "[ERROR #{index}] " message += "#{self.name.demodulize} - #{response['message']} (CODE: #{response['code']})" more_info = response['moreInfo'].to_s message += " (MORE INFO: #{more_info})" unless more_info.empty? message end end class ConnectionError < Error; end class UnexpectedError < Error; end class InternalError < Error; end class LicenceError < Error; end class LicenceExpiredError < Error; end class AccessDeniedError < Error; end class UnauthorizedOperationError < Error; end class NoResourceError < Error; end class InvalidRequestError < Error; end class SpaceOverCapacityError < Error; end class ResourceOverflowError < Error; end class TooLargeFileError < Error; end class AuthenticationError < Error; end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
backlog_kit-0.13.0 | lib/backlog_kit/error.rb |