1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 21:26:44 +02:00

globals.py: added fatal() function

This commit is contained in:
Igor Chubin
2019-04-29 20:05:13 +02:00
parent 7a05dc88e0
commit caf32b7c55
+5
View File
@@ -5,6 +5,7 @@ All hardcoded pathes and other data should be
"""
from __future__ import print_function
import sys
import logging
import os
import yaml
@@ -81,6 +82,10 @@ COLOR_STYLES = sorted(list(get_all_styles()))
MALFORMED_RESPONSE_HTML_PAGE = open(os.path.join(STATIC, 'malformed-response.html')).read()
def fatal(text):
sys.stderr.write("ERROR: %s\n" % text)
sys.exit(1)
def error(text):
"""
Log error `text` and produce a RuntimeError exception