Exception: Youtube::ProblemDetailsException

Inherits:
APIException
  • Object
show all
Defined in:
lib/youtube/exceptions/problem_details_exception.rb

Overview

ProblemDetails class.

Instance Attribute Summary collapse

Attributes inherited from APIException

#response, #response_code

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ ProblemDetailsException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpResponse)

    HttpReponse of the API call.



28
29
30
31
32
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 28

def initialize(reason, response)
  super(reason, response)
  hash = APIHelper.json_deserialize(@response.raw_body)
  unbox(hash)
end

Instance Attribute Details

#statusInteger (readonly)

TODO: Write general description for this method

Returns:

  • (Integer)


19
20
21
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 19

def status
  @status
end

#titleString (readonly)

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 15

def title
  @title
end

#trace_idString (readonly)

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 23

def trace_id
  @trace_id
end

#typeString (readonly)

TODO: Write general description for this method

Returns:

  • (String)


11
12
13
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 11

def type
  @type
end

Instance Method Details

#unbox(hash) ⇒ Object

Populates this object by extracting properties from a hash. response body.

Parameters:

  • The (Hash)

    deserialized response sent by the server in the



37
38
39
40
41
42
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 37

def unbox(hash)
  @type = hash['type']
  @title = hash['title']
  @status = hash['status']
  @trace_id = hash['traceId']
end