Sha256: 655fe336da625d5531c1115f808c2eff3b096bce8592deb02448f20d4678cbb2

Contents?: true

Size: 883 Bytes

Versions: 14

Compression:

Stored size: 883 Bytes

Contents

module Parse

  # Base exception class for errors thrown by the Parse
  # client library. ParseError will be raised by any
  # network operation if Parse.init() has not been called.
  class ParseError < StandardError #Exception ... why? A:http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/
  end

  # An exception class raised when the REST API returns an error.
  # The error code and message will be parsed out of the HTTP response,
  # which is also included in the response attribute.
  class ParseProtocolError < ParseError
    attr_accessor :code
    attr_accessor :error
    attr_accessor :response

    def initialize(response)
      #@response = response
      #if response.body
      #  data = JSON.parse response.body
      #  @code = data["code"]
      #  @message = data["error"]
      #end
      
      #{}"#{@code}: #{@message}"
    end
  end
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
parse-ruby-client-0.1.8 lib/parse/error.rb
parse-ruby-client-0.1.7 lib/parse/error.rb
parse-ruby-client-0.1.6 lib/parse/error.rb
parse-ruby-client-0.1.5 lib/parse/error.rb
parse-ruby-client-0.1.4 lib/parse/error.rb
parse-ruby-client-0.1.3 lib/parse/error.rb
parse-ruby-client-0.1.2 lib/parse/error.rb
parse-ruby-client-0.1.1 lib/parse/error.rb
parse-ruby-client-0.1.0 lib/parse/error.rb
parse-ruby-client-0.0.7 lib/parse/error.rb
parse-ruby-client-0.0.6 lib/parse/error.rb
parse-ruby-client-0.0.5 lib/parse/error.rb
parse-ruby-client-0.0.4 lib/parse/error.rb
parse-ruby-client-0.0.3 lib/parse/error.rb