mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-04 11:55:30 -04:00
Handle errors in the "/" endpoint
This commit is contained in:
parent
079dd8e280
commit
8506044232
@ -33,10 +33,15 @@ class MainRouter < Router
|
||||
end
|
||||
|
||||
get "/" do |env|
|
||||
begin
|
||||
titles = @context.library.titles
|
||||
username = get_username env
|
||||
percentage = titles.map &.load_percetage username
|
||||
layout "index"
|
||||
rescue e
|
||||
@context.error e
|
||||
env.response.status_code = 500
|
||||
end
|
||||
end
|
||||
|
||||
get "/book/:title" do |env|
|
||||
|
Loading…
x
Reference in New Issue
Block a user