<commit_before><?php

/*
 * This file is part of the Reviewing the Kanji package.
 * Copyright (c) 2005-2010	<NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * Exception thrown by REST actions
 *
 * @author <NAME>
 * @version 1
 * @copyright Turret Technology, LLC., 27 March, 2010
 * @package api
 * @subpackage lib
 **/

class apiRestException extends coreException
{
	private
		/**
		 * The status code to set in the response.
		 * @var integer
		 **/
		$statusCode = 500;

	/**
	 * Outputs the api REST exception XML.	Silently forwards to the unrouted module: rest, action: exception.
	 *	 This action handles the actual rendering of the error with a exceptionView.
	 *
	 * @return void
	 * @author <NAME>
	 **/
	public function printStackTrace()
	{
		$exception = is_null($this->wrappedException) ? $this : $this->wrappedException;
		$message	 = $exception->getMessage();

		$response = coreContext::getInstance()->getResponse();
		$response->setStatusCode($this->getStatusCode());

		// this sends a cookie unnecessarily
		$response->sendHttpHeaders(); 

		$context = coreContext::getInstance();
		<commit_msg>Fixed a comment.<commit_after><?php

/*
 * This file is part of the Reviewing the Kanji package.
 * Copyright (c) 2005-2010	<NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * Exception thrown by REST actions
 *
 * @author <NAME>
 * @version 1
 * @copyright Turret Technology, LLC., 27 March, 2010
 * @package api
 * @subpackage lib
 **/

class apiRestException extends coreException
{
	private
		/**
		 * The status code to set in the response.
		 * @var integer
		 **/
		$statusCode = 500;

	/**
	 * Outputs the api REST exception XML.	Silently forwards to the unrouted module: rest, action: exception.
	 *	 This action handles the actual rendering of the error with a exceptionView.
	 *
	 * @return void
	 **/
	public function printStackTrace()
	{
		$exception = is_null($this->wrappedException) ? $this : $this->wrappedException;
		$message	 = $exception->getMessage();

		$response = coreContext::getInstance()->getResponse();
		$response->setStatusCode($this->getStatusCode());

		// this sends a cookie unnecessarily
		$response->sendHttpHeaders(); 

		$context = coreContext::getInstance();
		
{'fraction_non_alphanumeric': 0.11733001658374792, 'fraction_numerical': 0.014925373134328358, 'mean_word_length': 3.778217821782178, 'pattern_counts': {'":': 0, '<': 10, '<?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': '2248947', 'n_tokens_mistral': 757, 'n_tokens_neox': 666, 'n_words': 244}