Add error pages for tag limit and pagination errors.

This commit is contained in:
evazion
2019-09-09 17:19:24 -05:00
parent 62b89e1f9a
commit 347aa4b835
6 changed files with 50 additions and 4 deletions

View File

@@ -62,9 +62,9 @@ class ApplicationController < ActionController::Base
when ActionController::UnknownFormat, ActionView::MissingTemplate
render_error_page(406, exception, message: "#{request.format.to_s} is not a supported format for this page")
when Danbooru::Paginator::PaginationError
render_error_page(410, exception)
render_error_page(410, exception, template: "static/pagination_error", message: "You cannot go beyond page #{Danbooru.config.max_numbered_pages}.")
when Post::SearchError
render_error_page(422, exception)
render_error_page(422, exception, template: "static/tag_limit_error", message: "You cannot search for more than #{CurrentUser.tag_query_limit} tags at a time.")
when ApiLimitError
render_error_page(429, exception)
when NotImplementedError