def METHOD_NAME(panic_code, a=None, b=None):
    """Create the panic message from templates"""
    if sabnzbd.WIN32:
        os_str = T("Press Startkey+R and type the line (example):")
        prog_path = '"%s"' % sabnzbd.MY_FULLNAME
    else:
        os_str = T("Open a Terminal window and type the line (example):")
        prog_path = sabnzbd.MY_FULLNAME
    if panic_code == PANIC_PORT:
        newport = int(b) + 1
        newport = "%s" % newport
        msg = MSG_BAD_PORT() % (b, a, os_str, prog_path, a, newport)
    elif panic_code == PANIC_TEMPL:
        msg = MSG_BAD_TEMPL() % a
    elif panic_code == PANIC_QUEUE:
        msg = MSG_BAD_QUEUE() % (a, os_str, prog_path)
    elif panic_code == PANIC_SQLITE:
        msg = MSG_SQLITE()
    elif panic_code == PANIC_HOST:
        msg = MSG_BAD_HOST() % (os_str, prog_path, "localhost", b)
    else:
        msg = MSG_OTHER() % (a, b)
    msg = MSG_BAD_NEWS() % (
        sabnzbd.MY_NAME,
        sabnzbd.__version__,
        sabnzbd.MY_NAME,
        sabnzbd.__version__,
        msg,
        T("Program did not start!"),
    )
    if sabnzbd.WIN_SERVICE:
        sabnzbd.WIN_SERVICE.ErrLogger("Panic exit", msg)
    if (not cfg.autobrowser()) or sabnzbd.DAEMON:
        return
    msgfile, url = tempfile.mkstemp(suffix=".html")
    os.write(msgfile, utob(msg))
    os.close(msgfile)
    return url