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
|
end
|
||||||
|
|
||||||
get "/" do |env|
|
get "/" do |env|
|
||||||
titles = @context.library.titles
|
begin
|
||||||
username = get_username env
|
titles = @context.library.titles
|
||||||
percentage = titles.map &.load_percetage username
|
username = get_username env
|
||||||
layout "index"
|
percentage = titles.map &.load_percetage username
|
||||||
|
layout "index"
|
||||||
|
rescue e
|
||||||
|
@context.error e
|
||||||
|
env.response.status_code = 500
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
get "/book/:title" do |env|
|
get "/book/:title" do |env|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user