Improve error handling
Change-Id: I1f54cf9cd4770d6602f70036cf0e27c9ede8c893
diff --git a/templates/exception.html.ep b/templates/exception.html.ep
index 7d8af3b..af0aaf6 100644
--- a/templates/exception.html.ep
+++ b/templates/exception.html.ep
@@ -1,6 +1,6 @@
% my $msg = $exception->message // '500: Internal Server Error';
% layout 'main', title => 'KorAP: ' . $msg;
-<p id="no-results"><%= $msg %></p>
+<p class="no-results"><%= $msg %></p>
% notify('error' => $msg);
diff --git a/templates/failure.html.ep b/templates/failure.html.ep
new file mode 100644
index 0000000..d9673b6
--- /dev/null
+++ b/templates/failure.html.ep
@@ -0,0 +1,10 @@
+% layout 'main', title => loc('searchtitle', q => stash('q'), ql => stash('ql')), schematype => 'SearchResultsPage';
+
+<div id="resultinfo"><p class="found"></p></div>
+
+%= include 'query2'
+
+<p class="no-results"><%= loc('notIssued') %></p>
+% if (stash('err_msg')) {
+<p class="no-results"><%= loc(stash('err_msg'),stash('err_msg')) %></p>
+% }
diff --git a/templates/not_found.html.ep b/templates/not_found.html.ep
index 953ab43..8410580 100644
--- a/templates/not_found.html.ep
+++ b/templates/not_found.html.ep
@@ -1,6 +1,6 @@
% my $msg = stash('msg') // loc('notFound');
% layout 'main', title => 'KorAP: ' . loc('notFound');
-<p id="no-results"><%= $msg %></p>
+<p class="no-results"><%= $msg %></p>
% notify('warn' => $msg);
diff --git a/templates/search2.html.ep b/templates/search2.html.ep
index 5a72ca5..907cc03 100644
--- a/templates/search2.html.ep
+++ b/templates/search2.html.ep
@@ -1,4 +1,5 @@
% layout 'main', title => loc('searchtitle', q => stash('q'), ql => stash('ql')), schematype => 'SearchResultsPage';
+
<div id="resultinfo" <% if (stash('results')->size) { %> class="found"<%} %>>
<div id="pagination"><%= pagination(stash('start_page'), stash('total_pages'), url_with->query(['p' => '{page}'])) =%></div>
% my $found = stash('total_results') // 0;
@@ -26,6 +27,6 @@
% end
</ol>
% } elsif (stash('results')->size == 0) {
-<p id="no-results"><%= loc 'noMatches', q => stash('q'), ql => stash('ql') %></p>
+<p class="no-results"><%= loc 'noMatches', q => stash('q'), ql => stash('ql') %></p>
% }
</div>