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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user