 		loc.iEnd = ListLen(arguments.formats);
 		for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
 		{
-			if (application.wheels.showErrorInformation && !ListFindNoCase(loc.possibleFormats, ListGetAt(arguments.formats, loc.i)))
-			{
-				$throw(type="Wheels.invalidFormat", message="An invalid format of `#ListGetAt(arguments.formats, loc.i)#` has been specific. The possible values are #loc.possibleFormats#.");
-			}
-		}
-		variables.$class.formats.default = ListAppend(variables.$class.formats.default, $listClean(arguments.formats));
+			loc.item = ListGetAt(arguments.formats, loc.i);
+			if (get("showErrorInformation") && !ListFindNoCase(loc.possibleFormats, loc.item))
+			{
+				$throw(type="Wheels.InvalidFormat", message="An invalid format of `#loc.item#` has been specified. The possible values are #loc.possibleFormats#.");
+			}
+		}
+		variables.$class.formats.default = ListAppend(variables.$class.formats.default, arguments.formats);
 	</cfscript>
 	<cfreturn>
 </cffunction>

		</cffunction>
	'
	categories="controller-request,provides" chapters="responding-with-multiple-formats" functions="provides,onlyProvides">
	<cfargument name="data" required="true" type="any" hint="Data to format and render." />
	<cfargument name="controller" type="string" required="false" default="#variables.params.controller#" hint="See documentation for @renderPage.">
	<cfargument name="action" type="string" required="false" default="#variables.params.action#" hint="See documentation for @renderPage.">
	<cfargument name="template" type="string" required="false" default="" hint="See documentation for @renderPage.">

				}
			}
		}
		if (!loc.returnValue && ListFindNoCase(variables.$class.formats.existingTemplates, arguments.$name))
		{
			loc.returnValue = true;
		}
	</cfscript>
	<cfreturn loc.returnValue>
</cffunction>
	
<cffunction name="$requestContentType" access="public" output="false" returntype="string">
	<cfargument name="params" type="struct" required="false" default="#variables.params#">
	<cfargument name="httpAccept" type="string" required="false" default="#request.cgi.http_accept#">
	<cfscript>
		var loc = {};
		loc.returnValue = "html";
		if (StructKeyExists(arguments.params, "format"))
		{
			loc.returnValue = arguments.params.format;
		}
		else
		{
			loc.formats = get("formats");
			for (loc.item in loc.formats)
			{
				if (FindNoCase(loc.formats[loc.item], arguments.httpAccept))
				{
					loc.returnValue = loc.item;
					break;
				}
			}
		}
	</cfscript>
	<cfreturn loc.returnValue>
</cffunction>