Skip to content
This repository was archived by the owner on Sep 22, 2020. It is now read-only.

Commit 6a4147b

Browse files
author
bg
committed
nicer colors for success and error
1 parent 3a7ff41 commit 6a4147b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

cs_proxy/proxy.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def main():
7676
healthcheck_tpl = default_header_tpl + """
7777
<span style="background:#99d100;padding:20px;color:#fff">&#10003; Proxy is running fine.</span>""" + default_footer_tpl
7878

79+
error_tpl = default_header_tpl + """
80+
<span style="background:#bf1101;padding:20px;color:#fff">&#10008; {{error.body}}</span>""" + default_footer_tpl
81+
7982
install_success_tpl = default_header_tpl + """
8083
<span style="background:#99d100;padding:20px;color:#fff">&#10003; Installation done.</span>""" + default_footer_tpl
8184

@@ -145,9 +148,6 @@ def proxy_trough_helper(url):
145148
return proxy_response
146149

147150

148-
def render_error_page(error):
149-
return template(default_tpl, headline='Error '+error.status, body=error.body)
150-
151151
#
152152
# BOTTLE APP
153153
#
@@ -158,11 +158,11 @@ def run_proxy(args):
158158
#
159159
@error(401)
160160
def error404(error):
161-
return render_error_page(error)
161+
return template(error_tpl, headline='Error '+error.status, error=error)
162162

163163
@error(500)
164164
def error500(error):
165-
return render_error_page(error)
165+
return template(error_tpl, headline='Error '+error.status, error=error)
166166

167167
#
168168
# SPECIAL ENDPOINTS

0 commit comments

Comments
 (0)