invidious-experimenting/src/invidious/exceptions.cr

33 lines
864 B
Crystal
Raw Normal View History

2022-07-20 00:35:49 +05:30
# 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
2022-03-27 05:50:00 +05:30
# Exception used to hold the bogus UCID during a channel search.
class ChannelSearchException < InfoException
getter channel : String
def initialize(@channel)
end
end
2022-02-03 04:32:24 +05:30
# Exception used to hold the name of the missing item
# Should be used in all parsing functions
class BrokenTubeException < Exception
2022-02-03 04:32:24 +05:30
getter element : String
def initialize(@element)
end
def message
return "Missing JSON element \"#{@element}\""
end
2022-02-03 04:32:24 +05:30
end
2022-07-07 01:29:05 +05:30
# Exception threw when an element is not found.
class NotFoundException < InfoException
end