SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post How to handle the fatal error uisng try --catch

    Hi friends,

    I have requirement is how to handle the fatal errors using Try -- Catch combination.with out use of set_error_handler function.If any one know please tell.

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Cannot, sorry. You need to use set_error_handler, an example is given here: http://us3.php.net/manual/en/functio...or-handler.php & http://us3.php.net/manual/en/class.errorexception.php
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    Non-Member adstiger's Avatar
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by swamyvnvs View Post
    Hi friends,

    I have requirement is how to handle the fatal errors using Try -- Catch combination.with out use of set_error_handler function.If any one know please tell.
    why don't you use set_error_handler function?

  4. #4
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It was my understanding that set_error_handler doesn't work on fatal errors. You can do some things with output buffering and setting unload functions, but that's about it. And I just did a quick test, and it seems to confirm to those findings.

    Am I missing something?

  5. #5
    SitePoint Evangelist
    Join Date
    Jun 2006
    Location
    Wigan, Lancashire. UK
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by UFTimmy View Post
    It was my understanding that set_error_handler doesn't work on fatal errors.
    Not all Fatal errors can be trapped anyway
    ---
    Development Projects:
    PHPExcel
    PHPPowerPoint

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for u r replay, i will try on this , mwill meet u later


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •