IT Community - Software Programming, Web Development and Technical Support

Customising the PHP Error Handler

This is a discussion on Customising the PHP Error Handler within the PHP Programming forums, part of the Web Development category; Guys, Customising the PHP Error Handler Introduction One of the last areas that developers seem to deal with in their ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-27-2007, 09:44 AM
sivaramakrishnan sivaramakrishnan is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 74
sivaramakrishnan is on a distinguished road
Post Customising the PHP Error Handler

Guys,

Customising the PHP Error Handler

Introduction

One of the last areas that developers seem to deal with in their code is error handling. I am not talking here about errors with user input where it is a simple matter to display an error message and ask for new input, I am taking about the kind of error over which the user has absolutely no control and which may cause the current PHP script to stop running. In this situation you as a developer need to know some details about the error otherwise you will have a very difficult time in locating the source of the error so that you can fix it.

Developers new to PHP often complain there there is no proper error handling in the language. This is utter nonsense. All the functionality is there, you just have to customise it to your specific requirements.

In this tutorial I will show to how to create an error handler that will:

• Trap all errors whether triggered by PHP or a specific function call.
• Filter all errors depending on their error level.
• Output a formatted error message to the user.
• Send an email to the system administrator.
• Write the error details to a separate log file.

Creating the Error Handler

Refer:Customizing the PHP Error Handler - Creating the Error Handler

Regards
sivaraman

Last edited by Booom : 08-27-2007 at 04:27 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: command line error MIDL1001 : cannot open input file wincodec.idl midl Mramesh C# Programming 0 02-18-2008 11:07 PM
Customizing the PHP Error Handler Sabari PHP Programming 2 12-18-2007 05:53 AM
Can I set up my own JavaScript error handler? itbarota HTML, CSS and Javascript Coding Techniques 1 09-13-2007 03:07 AM
Can I dynamically change the JavaScript error handler? itbarota HTML, CSS and Javascript Coding Techniques 1 09-13-2007 03:04 AM
example of Server.Transfer and Context Handler hanusoft ASP and ASP.NET Programming 1 09-06-2007 07:08 AM


All times are GMT -7. The time now is 02:38 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0