Skipping an error

Discussion in 'PHP' started by Googl, Aug 17, 2010.

  1. #1
    I would like to skip an error rather than ending the script in PHP. The error is triggered by a script and not a built in PHP error. I was wondering whether someone here might help me with the code. I know this can be done with PHP Exception Handling. But I would like someone to help me with the code.

    My code structure is:

    if (skip_this_error()){
    //Statements.
    }

    I would like to skip the skip_this_error() function if it generates an error. This is only an example.
     
    Googl, Aug 17, 2010 IP
  2. Googl

    Googl Active Member

    Messages:
    509
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    75
    #2
    Ok.. Ok..

    I will show you how to do it.

    try {
    //My code
    if (skip_this_error()){
    //Statements.
    }
    }
    catch(Exception $e) {
    //Do nothing
    }

    That's how you do it...
     
    Googl, Aug 17, 2010 IP
  3. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #3
    Did you try to put:

    in __finally{} block?
    Regards :)
     
    koko5, Aug 17, 2010 IP