Skip to content
Snippets Groups Projects
Commit e95ea419 authored by Aaron Bauman's avatar Aaron Bauman
Browse files

Exception namespaces

parent ec638c80
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,7 @@ abstract class SalesforceMappingFormBase extends EntityForm { ...@@ -81,7 +81,7 @@ abstract class SalesforceMappingFormBase extends EntityForm {
$salesforce_object_type = $this->entity->get('salesforce_object_type'); $salesforce_object_type = $this->entity->get('salesforce_object_type');
} }
if (empty($salesforce_object_type)) { if (empty($salesforce_object_type)) {
throw new Exception('Salesforce object type not set.'); throw new \Exception('Salesforce object type not set.');
} }
// No need to cache here: Salesforce::objectDescribe implements caching. // No need to cache here: Salesforce::objectDescribe implements caching.
return $this->client->objectDescribe($salesforce_object_type); return $this->client->objectDescribe($salesforce_object_type);
......
...@@ -84,7 +84,7 @@ class DeleteHandler { ...@@ -84,7 +84,7 @@ class DeleteHandler {
->getStorage($mapped_object->entity_type_id->value) ->getStorage($mapped_object->entity_type_id->value)
->load($mapped_object->entity_id->value); ->load($mapped_object->entity_id->value);
if (!$entity) { if (!$entity) {
throw new Exception(); throw new \Exception();
} }
} }
catch (\Exception $e) { catch (\Exception $e) {
......
...@@ -85,7 +85,7 @@ class PushQueue extends DatabaseQueue { ...@@ -85,7 +85,7 @@ class PushQueue extends DatabaseQueue {
if (empty($data['name']) if (empty($data['name'])
|| empty($data['entity_id']) || empty($data['entity_id'])
|| empty($data['op'])) { || empty($data['op'])) {
throw new Exception('Salesforce push queue data values are required for "name", "entity_id" and "op"'); throw new \Exception('Salesforce push queue data values are required for "name", "entity_id" and "op"');
} }
$this->name = $data['name']; $this->name = $data['name'];
$time = time(); $time = time();
...@@ -170,7 +170,7 @@ class PushQueue extends DatabaseQueue { ...@@ -170,7 +170,7 @@ class PushQueue extends DatabaseQueue {
* Use claimItems() instead. * Use claimItems() instead.
*/ */
public function claimItem($lease_time = NULL) { public function claimItem($lease_time = NULL) {
throw new Exception('This queue is designed to process multiple items at once. Please use "claimItems" instead.'); throw new \Exception('This queue is designed to process multiple items at once. Please use "claimItems" instead.');
} }
/** /**
......
...@@ -61,7 +61,7 @@ class RestResponse_Describe extends RestResponse { ...@@ -61,7 +61,7 @@ class RestResponse_Describe extends RestResponse {
*/ */
public function getField($field_name) { public function getField($field_name) {
if (empty($this->fields[$field_name])) { if (empty($this->fields[$field_name])) {
throw new Exception("No field $field_name"); throw new \Exception("No field $field_name");
} }
return $this->fields[$field_name]; return $this->fields[$field_name];
} }
......
...@@ -9,7 +9,7 @@ class SFID { ...@@ -9,7 +9,7 @@ class SFID {
public function __construct($id) { public function __construct($id) {
if (strlen($id) != 15 && strlen($id) != self::MAX_LENGTH) { if (strlen($id) != 15 && strlen($id) != self::MAX_LENGTH) {
throw new Exception('Invalid sfid'); throw new \Exception('Invalid sfid');
} }
$this->id = $id; $this->id = $id;
if (strlen($this->id) == 15) { if (strlen($this->id) == 15) {
......
...@@ -43,7 +43,7 @@ class SelectQueryResult { ...@@ -43,7 +43,7 @@ class SelectQueryResult {
public function record(SFID $id) { public function record(SFID $id) {
if (!isset($this->records[(string)$id])) { if (!isset($this->records[(string)$id])) {
throw new Exception('No record found'); throw new \Exception('No record found');
} }
return $this->records[(string)$id]; return $this->records[(string)$id];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment