Exception: BlueFactory::AuthorizationError
- Inherits:
-
StandardError
- Object
- StandardError
- BlueFactory::AuthorizationError
- Defined in:
- lib/blue_factory/errors.rb
Overview
Raised during request processing if the authorization token can't be parsed; it can also be thrown from the user's FeedHandler#get_posts method to indicate that the given user is not authorized to access the requested feed, or that the feed requires authentication and it wasn't provided.
The server intercepts this exception and returns a "401 Unauthorized" response to the AppView, which should result in the app displaying an error banner (along with the provided error message) in the feed view.
Instance Attribute Summary collapse
-
#error_type ⇒ String?
readonly
Machine-readable error identifier.
Instance Method Summary collapse
-
#initialize(message = "Authentication required", error_type = "AuthenticationRequired") ⇒ AuthorizationError
constructor
A new instance of AuthorizationError.
Constructor Details
#initialize(message = "Authentication required", error_type = "AuthenticationRequired") ⇒ AuthorizationError
Returns a new instance of AuthorizationError.
22 23 24 25 |
# File 'lib/blue_factory/errors.rb', line 22 def initialize( = "Authentication required", error_type = "AuthenticationRequired") super() @error_type = error_type end |
Instance Attribute Details
#error_type ⇒ String? (readonly)
Returns machine-readable error identifier.
17 18 19 |
# File 'lib/blue_factory/errors.rb', line 17 def error_type @error_type end |