import sys

def error_handler(whid, logger_name):
    logger_name = "%s-%s" % (whid, logger_name)
    logger = system.util.getLogger(logger_name)
    provider = "[%s_SCADA_TAG_PROVIDER]" % (whid)
    exc_type, exc_obj, tb = sys.exc_info()
    lineno = tb.tb_lineno
    logger.error("Error: %s, %s, %s" % (lineno, exc_type, exc_obj))
    system.tag.writeBlocking([provider + "System/wbsckt_running"], [0])
    