Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Refacto"

This reverts commit b1bec25.
  • Loading branch information...
commit 34cc5528685ce7307000eae6cd0a47e2ea561ca8 1 parent b1bec25
Xavier HAUSHERR authored
View
30 Api/Extensions/BaseExtension.php
@@ -76,37 +76,7 @@ public function getInstance($classe, $param = null)
}
/**
- * Return the Code Exception class name to use
- * @return string
- */
- protected function getCodeExceptionClassName()
- {
- return 'Overblog\ThriftBundle\Exception\Code';
- }
-
- /**
- * Generate Invalid value Exception
- * @param string $errorKey
- * @return InvalidValueException
- */
- protected function generateException($errorKey)
- {
- $codeClass = $this->getCodeExceptionClassName();
- $code = constant($codeClass . '::' . $errorKey);
-
- return $this->getInstance($this->getExceptionClassName(), array(
- 'code' => $code,
- 'message' => $codeClass::$_errorMessage[$code]
- ));
- }
-
- /**
* Return the Thrift Service Name to use
*/
abstract protected function getServiceName();
-
- /**
- * Return the Thrift Exception class name to use
- */
- abstract protected function getExceptionClassName();
}
View
7 Command/ClientCommand.php
@@ -23,7 +23,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$service = $this->getContainer()->get('thrift.client.user_socket');
$client = $service->getClient();
- $user = $client->getUserById(1456789);
+ $user = $client->getUserById(1);
var_dump($user);
@@ -63,10 +63,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
// $initializePopularity = $client->initializePopularity(1);
// var_dump($initializePopularity, (microtime(true) - $time_start));
}
- catch(\Exception $e)
+ catch(Overblog\InternalApiBundle\Thrift\packages\Comment\InvalidValueException $e)
{
- $output->writeln($e->getCode());
- $output->writeln($e->getMessage());
+ $output->writeln($e->error_msg);
}
}
}
View
15 Exception/Code.php
@@ -1,15 +0,0 @@
-<?php
-
-namespace Overblog\ThriftBundle\Exception;
-
-class Code
-{
- const WRONG_PARAMETER = 1001;
- const WRONG_TYPE_PARAMETER = 1002;
-
- static public $_errorMessage = array(
- self::WRONG_TYPE_PARAMETER => 'Wrong Type Parameter',
- self::WRONG_PARAMETER => 'Wrong Parameter'
- );
-
-}
Please sign in to comment.
Something went wrong with that request. Please try again.