Add new errors
Added NoCharacterProvidedError and NoSummonProvidedError
This commit is contained in:
parent
a208ea6bb7
commit
ea4ce4dcdc
2 changed files with 52 additions and 0 deletions
26
app/errors/api/v1/no_character_provided_error.rb
Normal file
26
app/errors/api/v1/no_character_provided_error.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class NoCharacterProvidedError < GranblueError
|
||||
def http_status
|
||||
422
|
||||
end
|
||||
|
||||
def code
|
||||
'no_character_provided'
|
||||
end
|
||||
|
||||
def message
|
||||
'A valid character must be provided'
|
||||
end
|
||||
|
||||
def to_hash
|
||||
{
|
||||
message: message,
|
||||
code: code
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
26
app/errors/api/v1/no_summon_provided_error.rb
Normal file
26
app/errors/api/v1/no_summon_provided_error.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class NoSummonProvidedError < GranblueError
|
||||
def http_status
|
||||
422
|
||||
end
|
||||
|
||||
def code
|
||||
'no_summon_provided'
|
||||
end
|
||||
|
||||
def message
|
||||
'A valid summon must be provided'
|
||||
end
|
||||
|
||||
def to_hash
|
||||
{
|
||||
message: message,
|
||||
code: code
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue