Initial commit
This commit is contained in:
13
app/api/v2/management/exceptions/authentication.rb
Normal file
13
app/api/v2/management/exceptions/authentication.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2
|
||||
module Management
|
||||
module Exceptions
|
||||
class Authentication < Base
|
||||
def status
|
||||
@options.fetch(:status, 401)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
22
app/api/v2/management/exceptions/base.rb
Normal file
22
app/api/v2/management/exceptions/base.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2
|
||||
module Management
|
||||
module Exceptions
|
||||
class Base < StandardError
|
||||
def initialize(message:, **options)
|
||||
@options = options
|
||||
super(message)
|
||||
end
|
||||
|
||||
def headers
|
||||
@options.fetch(:headers, {})
|
||||
end
|
||||
|
||||
def status
|
||||
@options.fetch(:status)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user