From cebe19d53f18a8b61afd9230d049de8c51cda898 Mon Sep 17 00:00:00 2001
From: Graham Cole <chckens@sucs.org>
Date: Sat, 19 Jan 2008 22:33:27 +0000
Subject: [PATCH] give some clues about how error handling works now

---
 components/README | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/components/README b/components/README
index ddb7f06..bcae188 100644
--- a/components/README
+++ b/components/README
@@ -35,3 +35,11 @@ $session->data		array for storing persistant data
 
 any values stored in data[] will be persistant between pages
 for as long as the users session cookie stays active.
+
+For error handling, your component should use the trigger_error() function:
+
+trigger_error("Informational message", E_USER_INFO); // To inform the user that something happened, e.g. the session expired
+trigger_error("Warning message", E_USER_WARNING); // Warn the user of an expected error, e.g. incorrect password
+trigger_error("Error message", E_USER_ERROR); // Reserved for unexpected conditions, e.g. unable to connect to database
+
+You may also use the message_flash("status message") function for helpful messages, e.g. form submitted
-- 
GitLab