aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/objects.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-05 12:52:13 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-05 12:52:13 +0000
commitc949e085c33b6eaf2e1dda4add566d47ab1876cd (patch)
tree648f4d1fd9e1565aeae53c40ae883570fe16963f /engine/lib/objects.php
parent152405d1b34b8ba1a27b288eba53bb29ed2bf228 (diff)
downloadelgg-c949e085c33b6eaf2e1dda4add566d47ab1876cd.tar.gz
elgg-c949e085c33b6eaf2e1dda4add566d47ab1876cd.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Partial internationalisation of exceptions git-svn-id: https://code.elgg.org/elgg/trunk@801 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/objects.php')
-rw-r--r--engine/lib/objects.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index b14e984c0..a51665b5b 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -55,7 +55,7 @@
if ($guid instanceof stdClass) {
// Load the rest
if (!$this->load($guid->guid))
- throw new IOException("Failed to load new ElggObject from GUID:$guid->guid");
+ throw new IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid->guid));
}
// Is $guid is an ElggObject? Use a copy constructor
@@ -67,15 +67,15 @@
// Is this is an ElggEntity but not an ElggObject = ERROR!
else if ($guid instanceof ElggEntity)
- throw new InvalidParameterException("Passing a non-ElggObject to an ElggObject constructor!");
+ throw new InvalidParameterException(elgg_echo('InvalidParameterException:NonElggObject'));
// We assume if we have got this far, $guid is an int
else if (is_numeric($guid)) {
- if (!$this->load($guid)) throw new IOException("Could not create a new ElggObject object from GUID:$guid");
+ if (!$this->load($guid)) IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
}
else
- throw new IOException("Unrecognised value passed to constuctor.");
+ throw new InvalidParameterException(elgg_echo('InvalidParameterException:UnrecognisedValue'));
}
}
@@ -112,7 +112,7 @@
// Check the type
if ($this->attributes['type']!='object')
- throw new InvalidClassException("GUID:$guid is not a valid ElggObject");
+ throw new InvalidClassException(sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, get_class()));
// Load missing data
$row = get_object_entity_as_row($guid);