Extract special exceptions from errors.cr

This commit is contained in:
syeopite 2021-11-14 06:02:37 -08:00
parent 9d3b93c45f
commit 3fe030bca9
No known key found for this signature in database
GPG key ID: 6FA616E5A5294A82
2 changed files with 23 additions and 8 deletions

View file

@ -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) macro error_template(*args)
error_template_helper(env, locale, {{*args}}) error_template_helper(env, locale, {{*args}})
end end

View 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