mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Extract special exceptions from errors.cr
This commit is contained in:
parent
9d3b93c45f
commit
3fe030bca9
2 changed files with 23 additions and 8 deletions
|
@ -1,11 +1,3 @@
|
|||
# InfoExceptions are for displaying information to the user.
|
||||
#
|
||||
# An InfoException might or might not indicate that something went wrong.
|
||||
# Historically Invidious didn't differentiate between these two options, so to
|
||||
# maintain previous functionality InfoExceptions do not print backtraces.
|
||||
class InfoException < Exception
|
||||
end
|
||||
|
||||
macro error_template(*args)
|
||||
error_template_helper(env, locale, {{*args}})
|
||||
end
|
||||
|
|
23
src/invidious/errors/special_exceptions.cr
Normal file
23
src/invidious/errors/special_exceptions.cr
Normal file
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# This file contains special exceptions whose error page differ from the norm.
|
||||
#
|
||||
|
||||
# InfoExceptions are for displaying information to the user.
|
||||
#
|
||||
# An InfoException might or might not indicate that something went wrong.
|
||||
# Historically Invidious didn't differentiate between these two options, so to
|
||||
# maintain previous functionality InfoExceptions do not print backtraces.
|
||||
class InfoException < Exception
|
||||
end
|
||||
|
||||
# InitialInnerTubeParseExceptions are for used to display extra information on
|
||||
# the error page for debugging/research purposes.
|
||||
#
|
||||
class InitialInnerTubeParseException < Exception
|
||||
# temporally place holder
|
||||
def self.new(parse_exception, **kwargs)
|
||||
instance = InitialInnerTubeParseException.allocate
|
||||
instance.initialize(error_message, parse_exception)
|
||||
return instance
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue