Skip to content

Commit 56e5051

Browse files
404 error with message and provide example
1 parent d4f3139 commit 56e5051

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/invidious/routes/search.cr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ module Invidious::Routes::Search
5555

5656
begin
5757
search_query, count, videos, operators = process_search_query(query, page, user, region: region)
58+
rescue ex : ChannelSearchException
59+
return error_template(404, "Unable to find channel with id of '#{ex.channel}'. Are you sure that's an actual channel id? It will look like 'UC4QobU6STFB0P71PMvOGN5A'.")
5860
rescue ex
5961
return error_template(500, ex)
6062
end

src/invidious/search.cr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class ChannelSearchException < InfoException
2-
def initialize(channel : String)
3-
super "Unable to find channel with id of '#{channel}'. Are you sure that's an actual channel id?"
2+
getter channel : String
3+
4+
def initialize(@channel)
45
end
56
end
67

0 commit comments

Comments
 (0)