aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 2184fee41..dcc468cd7 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -88,7 +88,7 @@ function elgg_register_library($name, $location) {
* @param string $name The name of the library
*
* @return void
- * @throws Exception
+ * @throws InvalidParameterException
* @since 1.8.0
*/
function elgg_load_library($name) {
@@ -99,11 +99,13 @@ function elgg_load_library($name) {
}
if (!isset($CONFIG->libraries[$name])) {
- throw new Exception("Failed to load the $name library");
+ $error = elgg_echo('InvalidParameterException:LibraryNotRegistered', array($name));
+ throw new InvalidParameterException($error);
}
if (!include_once($CONFIG->libraries[$name])) {
- throw new Exception("Failed to load the $name library");
+ $error = elgg_echo('InvalidParameterException:LibraryNotRegistered', array($name));
+ throw new InvalidParameterException($error);
}
}