From 2067d1a727e7eb5e5ffb40e967f3d1fc4c8a41b2 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 13 Nov 2008 22:59:24 +0000 Subject: Changing EOL style to LF --- user_guide/general/errors.html | 272 ++++++++++++++++++++--------------------- 1 file changed, 136 insertions(+), 136 deletions(-) (limited to 'user_guide/general/errors.html') diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 07dc1b3df..036eacaee 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -1,137 +1,137 @@ - - - - - -Error Handling : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
- - - - - -

CodeIgniter User Guide Version 1.7

-
- - - - - - - - - -
- - -
- - - -
- -

Error Handling

- -

CodeIgniter lets you build error reporting into your applications using the functions described below. -In addition, it has an error logging class that permits error and debugging messages to be saved as text files.

- -

Note: By default, CodeIgniter displays all PHP errors. You might -wish to change this behavior once your development is complete. You'll find the error_reporting() -function located at the top of your main index.php file. Disabling error reporting will NOT prevent log files -from being written if there are errors.

- -

Unlike most systems in CodeIgniter, the error functions are simple procedural interfaces that are available -globally throughout the application. This approach permits error messages to get triggered without having to worry -about class/function scoping.

- -

The following functions let you generate errors:

- -

show_error('message')

-

This function will display the error message supplied to it using the following error template:

-

application/errors/error_general.php

- -

show_404('page')

-

This function will display the 404 error message supplied to it using the following error template:

-

application/errors/error_404.php

- -

The function expects the string passed to it to be the file path to the page that isn't found. -Note that CodeIgniter automatically shows 404 messages if controllers are not found.

- - -

log_message('level', 'message')

- -

This function lets you write messages to your log files. You must supply one of three "levels" -in the first parameter, indicating what type of message it is (debug, error, info), with the message -itself in the second parameter. Example:

- - -if ($some_var == "")
-{
-    log_message('error', 'Some variable did not contain a value.');
-}
-else
-{
-    log_message('debug', 'Some variable was correctly set');
-}
-
-log_message('info', 'The purpose of some variable is to provide some value.');
-
- -

There are three message types:

- -
    -
  1. Error Messages. These are actual errors, such as PHP errors or user errors.
  2. -
  3. Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info.
  4. -
  5. Informational Messages. These are the lowest priority messages, simply giving information regarding some process. CodeIgniter doesn't natively generate any info messages but you may want to in your application.
  6. -
- - -

Note: In order for the log file to actually be written, the - "logs" folder must be writable. In addition, you must set the "threshold" for logging. -You might, for example, only want error messages to be logged, and not the other two types. -If you set it to zero logging will be disabled.

- - - -
- - - - - - + + + + + +Error Handling : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

CodeIgniter User Guide Version 1.7

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Error Handling

+ +

CodeIgniter lets you build error reporting into your applications using the functions described below. +In addition, it has an error logging class that permits error and debugging messages to be saved as text files.

+ +

Note: By default, CodeIgniter displays all PHP errors. You might +wish to change this behavior once your development is complete. You'll find the error_reporting() +function located at the top of your main index.php file. Disabling error reporting will NOT prevent log files +from being written if there are errors.

+ +

Unlike most systems in CodeIgniter, the error functions are simple procedural interfaces that are available +globally throughout the application. This approach permits error messages to get triggered without having to worry +about class/function scoping.

+ +

The following functions let you generate errors:

+ +

show_error('message')

+

This function will display the error message supplied to it using the following error template:

+

application/errors/error_general.php

+ +

show_404('page')

+

This function will display the 404 error message supplied to it using the following error template:

+

application/errors/error_404.php

+ +

The function expects the string passed to it to be the file path to the page that isn't found. +Note that CodeIgniter automatically shows 404 messages if controllers are not found.

+ + +

log_message('level', 'message')

+ +

This function lets you write messages to your log files. You must supply one of three "levels" +in the first parameter, indicating what type of message it is (debug, error, info), with the message +itself in the second parameter. Example:

+ + +if ($some_var == "")
+{
+    log_message('error', 'Some variable did not contain a value.');
+}
+else
+{
+    log_message('debug', 'Some variable was correctly set');
+}
+
+log_message('info', 'The purpose of some variable is to provide some value.');
+
+ +

There are three message types:

+ +
    +
  1. Error Messages. These are actual errors, such as PHP errors or user errors.
  2. +
  3. Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info.
  4. +
  5. Informational Messages. These are the lowest priority messages, simply giving information regarding some process. CodeIgniter doesn't natively generate any info messages but you may want to in your application.
  6. +
+ + +

Note: In order for the log file to actually be written, the + "logs" folder must be writable. In addition, you must set the "threshold" for logging. +You might, for example, only want error messages to be logged, and not the other two types. +If you set it to zero logging will be disabled.

+ + + +
+ + + + + + \ No newline at end of file -- cgit v1.2.3-24-g4f1b