Skip to content

raise_http_exception.rb#parse_json: undefined method [] for ni:NilClass (NoMethodError) #125

@ybakos

Description

@ybakos

When my app has not o-authed with QBO, the qbo_api used to elegantly raise an exception, that we could rescue and do a redirect.

v3.0.1 seems to have a regression.

/Users/ybakos/.rvm/gems/ruby-3.1.1@rugged_thread/gems/qbo_api-3.0.1/lib/qbo_api/raise_http_exception.rb:72:in parse_json': undefined method []' for nil:NilClass (NoMethodError)

  errors = fault['Error'] || fault['error']

To replicate:

Do not have a valid authentication token.
Invoke qbo_api.all(:customer_type).count.

The behavior was different in 2.0.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions