<commit_before>// error.js

(function($){

$(document).ajaxError(function(event, xhr, ajaxOptions, thrownError){
	if (xhr && xhr.status >= 400 && xhr.status != 409) {
		showError(event, xhr.statusText, xhr.responseText);
	} else if (thrownError) {
		showError(event, thrownError);
	} else if (xhr && xhr.status < 100) {
		showError(event, "Could not connect to server, please try again later");
	}
});

$(document).ajaxSuccess(function(event, xhr, ajaxOptions){
	if (xhr && xhr.status >= 200 && xhr.status < 300) {
		$("#error-widget").hide();
		$("#error-message").empty();
		$("#error-widget pre").remove();
	}
});<commit_msg>Don't show connection errors if page is unloading<commit_after>// error.js

(function($){

var unloading = false;
$(window).bind('beforeunload', function() {
	unloading = true;
});

$(document).ajaxError(function(event, xhr, ajaxOptions, thrownError){
	if (xhr && xhr.status >= 400 && xhr.status != 409) {
		showError(event, xhr.statusText, xhr.responseText);
	} else if (thrownError) {
		showError(event, thrownError);
	} else if (xhr && xhr.status < 100 && !unloading) {
		showError(event, "Could not connect to server, please try again later");
	}
});

$(document).ajaxSuccess(function(event, xhr, ajaxOptions){
	if (xhr && xhr.status >= 200 && xhr.status < 300) {
		$("#error-widget").hide();
		$("#error-message").empty();
		$("#error-widget pre").remove();
	}
});
{'fraction_non_alphanumeric': 0.19899785254115962, 'fraction_numerical': 0.021474588403722263, 'mean_word_length': 4.873949579831932, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '4857864', 'n_tokens_mistral': 521, 'n_tokens_neox': 479, 'n_words': 113}