From 7cdf1da13d12adf1b8400d5e8d0f4e2323fe6bd0 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 4 Nov 2005 18:18:44 +0000 Subject: [PATCH] Converting errors to use the new APIError() system --- api.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/api.php b/api.php index f2df06a..030b096 100644 --- a/api.php +++ b/api.php @@ -189,8 +189,7 @@ class API if (!$verify) { - // - trigger_error('Validation of `' . $field . '` failed', E_USER_ERROR); + $this->error(sprintf($this->registry->modules['localize']->string('Validation of %1$s failed'), $field)); } } } @@ -269,8 +268,7 @@ class API $result = $this->registry->modules['db_mysql']->query_first("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); if (!$result) { - // - trigger_error('No record was returned', E_USER_ERROR); + $this->error($this->registry->modules['localize']->string('No records were returned')); return; } @@ -353,8 +351,7 @@ class API { if (!isset($this->values["$name"])) { - // - trigger_error('Field `' . $name . '` was not set', E_USER_ERROR); + $this->error(sprintf($this->registry->modules['localize']->string('Required field %1$s was not set'), $name)); } } else if ($options[F_REQ] == REQ_SET) -- 2.43.5