<commit_before><?php
class Pleesher_GetUserPageOutputAction extends Pleesher_Action
{
	public function getAllowedParams()
	{
		return array_merge(parent::getAllowedParams(), [
			'username' => null
		]);
	}

	protected function doExecute()
	{
		$user_name = $this->getParameter('username');

		$output = '';
		try {
			$achievement_count = count(PleesherExtension::getAchievements($user_name)) ?: 0;
			$showcased_achievement_count = count(PleesherExtension::getShowcasedAchievements($user_name));
			$goal_count = count(PleesherExtension::$goal_data);

			$user = PleesherExtension::getUser($user_name);
			if (!is_object($user))
				return;

			if (!empty($output))
				$output .= PHP_EOL . PHP_EOL;

			$output .= PleesherExtension::render('user', array_merge(PleesherExtension::$implementation->getUserPageData($user), [
				'user' => $user,
				'closest_achievements' => PleesherExtension::getClosestAchievements($user_name, 3),
				'achievement_count' => $achievement_count,
				'showcased_achievement_count' => $showcased_achievement_count,
				'goal_count' => $goal_count
			]));

		} catch (Exception $e)
		{
			if (!empty($output))
				$output .= PHP_EOL . PHP_EOL;

			if ($e instanceof PleesherDisabledException)
				$output .= PleesherExtension::render('disabled');
			else
				$output .= PleesherExtension::render('error', ['error_message' => PleesherExtension::$view_helper->text('pleesher.error.text.' . ($e->getErrorCode() ?: 'generic'), $e->getErrorParameters() ?: [])]);
		}

		$this->getResult()->addValue(null, 'output', $output);
	}
}<commit_msg>Missing fallback to default exception handler (to catch errors directly)<commit_after><?php
class Pleesher_GetUserPageOutputAction extends Pleesher_Action
{
	public function getAllowedParams()
	{
		return array_merge(parent::getAllowedParams(), [
			'username' => null
		]);
	}

	protected function doExecute()
	{
		$user_name = $this->getParameter('username');

		$output = '';

		PleesherExtension::$pleesher->setExceptionHandler(PleesherExtension::$pleesher->getDefaultExceptionHandler());

		try {
			$achievement_count = count(PleesherExtension::getAchievements($user_name)) ?: 0;
			$showcased_achievement_count = count(PleesherExtension::getShowcasedAchievements($user_name));
			$goal_count = count(PleesherExtension::$goal_data);

			$user = PleesherExtension::getUser($user_name);
			if (!is_object($user))
				return;

			if (!empty($output))
				$output .= PHP_EOL . PHP_EOL;

			$output .= PleesherExtension::render('user', array_merge(PleesherExtension::$implementation->getUserPageData($user), [
				'user' => $user,
				'closest_achievements' => PleesherExtension::getClosestAchievements($user_name, 3),
				'achievement_count' => $achievement_count,
				'showcased_achievement_count' => $showcased_achievement_count,
				'goal_count' => $goal_count
			]));

		} catch (Exception $e)
		{
			if (!empty($output))
				$output .= PHP_EOL . PHP_EOL;

			if ($e instanceof PleesherDisabledException)
				$output .= PleesherExtension::render('disabled');
			else
				$output .= PleesherExtension::render('error', ['error_message' => PleesherExtension::$view_helper->text('pleesher.error.text.' . ($e->getErrorCode() ?: 'generic'), $e->getErrorParameters() ?: [])]);
		}

		PleesherExtension::$pleesher->restoreExceptionHandler();

		$this->getResult()->addValue(null, 'output', $output);
	}
}
{'fraction_non_alphanumeric': 0.15875370919881307, 'fraction_numerical': 0.0011869436201780415, 'mean_word_length': 5.7151394422310755, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, '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': '1539173', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1122, 'n_words': 161}