13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/perron/site/builder/page.rb', line 13
def render
info = route_info
return puts " ❌ ERROR: No route matches '#{@path}'" unless info
request = ActionDispatch::Request.new(env)
response = ActionDispatch::Response.new
request.path_parameters = info
controller.dispatch(info[:action], request, response)
return puts " ❌ ERROR: Request failed for '#{@path}' (Status: #{response.status})" unless response.successful?
save_html(response.body)
rescue => error
puts " ❌ ERROR: Failed to generate page for '#{@path}'. Details: #{error.class} - #{error.message}\n#{error.backtrace.first(3).join("\n")}"
end
|