<commit_before>from flask import Flask, make_response

from auslib.AUS import AUS3

app = Flask(__name__)
AUS = AUS3()

@app.errorhandler(404)
def fourohfour(error):
    """We don't return 404s in AUS. Instead, we return empty XML files"""
    response = make_response('<?xml version="1.0"?>\n<updates>\n</updates>')
    response.mimetype = 'text/xml'
    return response

from auslib.client.views.client import *<commit_msg>bug 712430: add extra logging for HTTP 500 errors in balrog in the client, too. r=catlee<commit_after>from flask import Flask, make_response

from auslib import version
from auslib.AUS import AUS3

app = Flask(__name__)
AUS = AUS3()

@app.errorhandler(404)
def fourohfour(error):
    """We don't return 404s in AUS. Instead, we return empty XML files"""
    response = make_response('<?xml version="1.0"?>\n<updates>\n</updates>')
    response.mimetype = 'text/xml'
    return response

@app.errorhandler(500)
def isa(error):
    log.error("Caught ISA 500 error.")
    log.debug("Balrog version is: %s", version)
    log.debug("Request path is: %s", request.path)
    log.debug("Request environment is: %s", request.environ)
    log.debug("Request headers are: %s", request.headers)
    return error

from auslib.client.views.client import *
{'fraction_non_alphanumeric': 0.12954186413902052, 'fraction_numerical': 0.02764612954186414, 'mean_word_length': 4.437768240343348, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 2, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1738579', 'n_tokens_mistral': 446, 'n_tokens_neox': 422, 'n_words': 124}