Avoid errors by explicitely namespacing root exception

This commit is contained in:
Romain Neutron
2014-02-20 11:28:31 +01:00
parent fab9a64ae0
commit 2af21c064c
73 changed files with 164 additions and 164 deletions

View File

@@ -192,7 +192,7 @@ class API_OAuth2_Adapter extends OAuth2
}
return ($application->get_client_secret() === $client_secret);
} catch (Exception $e) {
} catch (\Exception $e) {
}
@@ -237,7 +237,7 @@ class API_OAuth2_Adapter extends OAuth2
, 'oauth_token' => $token->get_value()
);
} catch (Exception $e) {
} catch (\Exception $e) {
}
@@ -306,7 +306,7 @@ class API_OAuth2_Adapter extends OAuth2
, 'expires' => $code->get_expires()
, 'account_id' => $code->get_account()->get_id()
);
} catch (Exception $e) {
} catch (\Exception $e) {
}
@@ -357,7 +357,7 @@ class API_OAuth2_Adapter extends OAuth2
, 'expires' => $token->get_expires()->format('U')
, 'client_id' => $token->get_account()->get_application()->get_client_id()
);
} catch (Exception $e) {
} catch (\Exception $e) {
}
@@ -519,7 +519,7 @@ class API_OAuth2_Adapter extends OAuth2
try {
$user = User_Adapter::getInstance($usr_id, $this->app);
$account = API_OAuth2_Account::load_with_user($this->app, $this->client, $user);
} catch (Exception $e) {
} catch (\Exception $e) {
$account = $this->createAccount($usr_id);
}
@@ -586,7 +586,7 @@ class API_OAuth2_Adapter extends OAuth2
$token->set_session_id($ses_id);
return true;
} catch (Exception $e) {
} catch (\Exception $e) {
}

View File

@@ -1101,7 +1101,7 @@ class API_V1_adapter extends API_V1_Abstract
$record->set_metadatas($metadatas);
$result->set_datas(array("record_metadatas" => $this->list_record_caption($record->get_caption())));
} catch (Exception $e) {
} catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
}
@@ -1147,7 +1147,7 @@ class API_V1_adapter extends API_V1_Abstract
$this->list_record_status($databox, $record->get_status())
)
);
} catch (Exception $e) {
} catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
}
@@ -1173,7 +1173,7 @@ class API_V1_adapter extends API_V1_Abstract
$record->move_to_collection($collection, $this->app['phraseanet.appbox']);
$result->set_datas(array("record" => $this->list_record($record)));
} catch (Exception $e) {
} catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $e->getMessage());
}
@@ -1197,7 +1197,7 @@ class API_V1_adapter extends API_V1_Abstract
$result->set_datas(array('record' => $this->list_record($record)));
} catch (NotFoundHttpException $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('Record Not Found'));
} catch (Exception $e) {
} catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
}
@@ -1221,7 +1221,7 @@ class API_V1_adapter extends API_V1_Abstract
$result->set_datas(array('story' => $this->list_story($story)));
} catch (NotFoundHttpException $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('Story Not Found'));
} catch (Exception $e) {
} catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
}