<commit_before><?php
class Conekta_Error extends Exception
{
	public function __construct($message, $type, $code, $params) {
		parent::__construct($message);
		$this->message = $message;
		$this->type = $type;
		$this->code = $code;
		$this->params = $params;
	}
	
	public static function errorHandler($resp, $code) {
		$resp = json_decode($resp, true);
		$message = $resp['message'];
		$type = $resp['type'];
		$params = $resp['params'];
		if (isset($code) != true) {
			throw new Conekta_Error('Could not connect to '.Conekta::$apiBase, $type, $code, $params);
		}
		switch ($code) {
			case 400:
				throw new Conekta_MalformedRequestError($message, $type, $code, $params);
			case 401:
				throw new Conekta_AuthenticationError($message, $type, $code, $params);
			case 402:
				throw new Conekta_ProcessingError($message, $type, $code, $params);
			case 404:
				throw new Conekta_ResourceNotFoundError($message, $type, $code, $params);
			case 422:
				throw new Conekta_ParameterValidationError($message, $type, $code, $params);
			case 500:
				throw new Conekta_ApiError($message, $type, $code, $params);
			default:
				throw new Conekta_Error($message, $type, $code, $params);
		}
	}
}

class Conekta_ApiError extends Conekta_Error {
	
}

class Conekta_AuthenticationError extends Conekta_Error {
	
}

class Conekta_ParameterValidationError extends Conekta_Error {
	
}

class Conekta_ProcessingError extends Conekta_Error {
	
}

class Conekta_ResourceNotFoundError extends Conekta_Error {
	
}

class Conekta_MalformedRequestError extends Conekta_Error {
	
}
?><commit_msg>fix syntax error in error.php<commit_after><?php
class Conekta_Error extends Exception
{
	public function __construct($message, $type, $code, $params) {
		parent::__construct($message);
		$this->message = $message;
		$this->type = $type;
		$this->code = $code;
		$this->params = $params;
	}
	
	public static function errorHandler($resp, $code) {
		$resp = json_decode($resp, true);
		$message = isset($resp['message']) ? $resp['message'] : null;
		$type = isset($resp['type']) ? $resp['type'] : null;
		$params = isset($resp['params']) ? $resp['params'] : null;
		if (isset($code) != true || $code == 0) {
			throw new Conekta_Error('Could not connect to '.Conekta::$apiBase, $type, $code, $params);
		}
		echo 'Hola' . $code ;
		switch ($code) {
			case 400:
				throw new Conekta_MalformedRequestError($message, $type, $code, $params);
			case 401:
				throw new Conekta_AuthenticationError($message, $type, $code, $params);
			case 402:
				throw new Conekta_ProcessingError($message, $type, $code, $params);
			case 404:
				throw new Conekta_ResourceNotFoundError($message, $type, $code, $params);
			case 422:
				throw new Conekta_ParameterValidationError($message, $type, $code, $params);
			case 500:
				throw new Conekta_ApiError($message, $type, $code, $params);
			default:
				throw new Conekta_Error($message, $type, $code, $params);
		}
	}
}

	class Conekta_ApiError extends Conekta_Error {
		
	}

	class Conekta_AuthenticationError extends Conekta_Error {
		
	}

	class Conekta_ParameterValidationError extends Conekta_Error {
		
	}

	class Conekta_ProcessingError extends Conekta_Error {
		
	}

	class Conekta_ResourceNotFoundError extends Conekta_Error {
		
	}

	class Conekta_MalformedRequestError extends Conekta_Error {
		
	}
?>
{'fraction_non_alphanumeric': 0.135013501350135, 'fraction_numerical': 0.0111011101110111, 'mean_word_length': 4.748275862068965, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4972109', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1149, 'n_words': 271}