Skip to content

Commit 44e3962

Browse files
committed
Internal error handling
1 parent 0ac6cdc commit 44e3962

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

frontend/pages/error.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<%- include('head.ejs') %>
2-
<img src="<%= tenant.logo %>" alt="<%= tenant.name %>">
3-
<h1> <%= title || 'Error' %></h1>
4-
<p><%= message %></p>
2+
<% if ((typeof tenant !== 'undefined') && tenant && tenant.logo && tenant.name) { %><img src="<%= tenant.logo %>" alt="<%= tenant.name %>"><% } %>
3+
<% if (typeof title !== 'undefined') { %><h1> <%= title || 'Error' %></h1><% } %>
4+
<% if (typeof message !== 'undefined') { %><p><%= message %></p><% } %>
55
<%- include('foot.ejs') %>

frontend/pages/foot.ejs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
</div>
2+
<% if (typeof tenant !== 'undefined') { %>
23
<p class="fixed">© <%= new Date().getFullYear() %> CommTrackr</p>
34
<p class="fixed2">Changes saved</p>
5+
<% } else { %>
6+
<p class="fixed">Internal error</p>
7+
<% } %>
48
</main>
9+
<% if (typeof tenant !== 'undefined') { %>
510
<script>
611
const appPath = '<%= tenant.domain %><%= tenant.path %>';
712
</script>
813
<script src="<%= tenant.domain %><%= tenant.path %>/scripts.js" type="module"></script>
14+
<% } %>
915
</body>
1016

1117
</html>

frontend/pages/head.ejs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!DOCTYPE html>
22
<html lang="en">
33

4+
<% if (typeof tenant !== 'undefined') { %>
45
<head>
56
<meta charset="UTF-8">
67
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -22,6 +23,7 @@
2223
<link rel="apple-touch-icon" href="<%= tenant.logo %>">
2324
<link rel="stylesheet" href="<%= tenant.domain %><%= tenant.path %>/styles.css">
2425
</head>
26+
<% } %>
2527

2628
<body>
2729
<main>

0 commit comments

Comments
 (0)