<commit_before><cfscript>
function ComponentListPackageAsStruct(string package, cfcNames=structnew("linked")){
	try{
		local._cfcNames=ComponentListPackage(package);
		loop array="#_cfcNames#" index="i" item="el" {
			cfcNames[el]=package&"."&el;
		}
	}
	catch(e){}
	return cfcNames;
	
}
	
/**
* cast a String to a File Object
* @param strFile string to cast
* @return File Object
*/
function printError(error,boolean longversion=false) {
	if(IsSimpleValue(arguments.error))arguments.error=struct(message:arguments.error);
	if(not StructKeyExists(arguments.error,'detail'))arguments.error.detail="";
	else if(arguments.error.message EQ arguments.error.detail)arguments.error.detail="";

	if(StructKeyExists(arguments.error,'message') and arguments.error.message NEQ "") {
		writeOutput('<div class="error">');
		writeOutput(br(arguments.error.message));
		writeOutput('<br>');
		writeOutput(br(arguments.error.detail));
		
		if(longversion) {
			if(StructKeyExists(error,"TagContext")){
				loop array="#error.TagContext#" index="local.i" item="local.tc" {
					writeOutput('<br><span class="comment">');<commit_msg>Added stack trace in Collapsible div mode<commit_after><cfscript>
function ComponentListPackageAsStruct(string package, cfcNames=structnew("linked")){
	try{
		local._cfcNames=ComponentListPackage(package);
		loop array="#_cfcNames#" index="i" item="el" {
			cfcNames[el]=package&"."&el;
		}
	}
	catch(e){}
	return cfcNames;
	
}
	
/**
* cast a String to a File Object
* @param strFile string to cast
* @return File Object
*/
function printError(error,boolean longversion=false) {
	if(IsSimpleValue(arguments.error))arguments.error=struct(message:arguments.error);
	if(not StructKeyExists(arguments.error,'detail'))arguments.error.detail="";
	else if(arguments.error.message EQ arguments.error.detail)arguments.error.detail="";

	if(StructKeyExists(arguments.error,'message') and arguments.error.message NEQ "") {
		writeOutput('<div class="error">');
		writeOutput(br(arguments.error.message));
		if(StructKeyExists(arguments.error.cfcatch.cause,'StackTrace') and arguments.error.cfcatch.cause.StackTrace NEQ ""){
			savecontent variable="test" {
				echo('<span>
				<button onclick="ErrorDetails()" id="button">View Details</button>
				</span>
				<script>
				function ErrorDetails(){
					var div = document.getElementById("StackTrace");
					if(div.style.display === "block"){
						div.style.display =  "None";
						document.getElementById("button").innerHTML = "View Details";
					} else {
				        div.style.display = "block";
				        document.getElementById("button").innerHTML = "Hide Details";
				    }
				}
				</script>
				<div id="StackTrace"  style="display: none;"> <br>');
				echo(arguments.error.cfcatch.cause.StackTrace);
				echo('</div>');
			}
			writeOutput(test);
		}
		writeOutput('<br>');
		writeOutput(br(arguments.error.detail));
		
		if(longversion) {
			if(StructKeyExists(error,"TagContext")){
				loop array="#error.TagContext#" index="local.i" item="local.tc" {
					writeOutput('<br><span class="comment">');
{'fraction_non_alphanumeric': 0.16444154998371865, 'fraction_numerical': 0.0, 'mean_word_length': 5.308008213552362, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '248768', 'n_tokens_mistral': 1069, 'n_tokens_neox': 933, 'n_words': 159}