Exception: LabelZoom::ForbiddenError

Inherits:
APIError show all
Defined in:
lib/labelzoom/errors.rb

Overview

HTTP 403. The credential is valid but not entitled to this operation.

Instance Attribute Summary

Attributes inherited from APIError

#raw_body, #request_id, #status

Instance Method Summary collapse

Constructor Details

#initialize(message, paid_feature: false, **kwargs) ⇒ ForbiddenError

Returns a new instance of ForbiddenError.



39
40
41
42
# File 'lib/labelzoom/errors.rb', line 39

def initialize(message, paid_feature: false, **kwargs)
  super(message, **kwargs)
  @paid_feature = paid_feature
end

Instance Method Details

True when this 403 is a paywall rather than a permissions problem -- "JSON export is a paid feature" and friends. By far the most common anonymous-tier failure, so it gets a predicate instead of leaving callers to match strings.

Returns:

  • (Boolean)


47
# File 'lib/labelzoom/errors.rb', line 47

def paid_feature? = @paid_feature