public static function writeException(\Exception $ex)
	{
		$response = array(
			'exception' => get_class($ex),
			'message' => $ex->getMessage(),
			'code' => $ex->getCode(),
		);
		static::writeJson($response);
	}