Announcement

Collapse
No announcement yet.

Cannot suppress errors...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot suppress errors...

    I need to retrieve data from another website and I use file_get_contents for that. When something goes wrong I want to test the status (return value) which will be true or false. However, scriptcase throws an error which I don't want. In standard php I can suppress this by using @. So it would be: $rtn=@file_get_contents(......

    It works in regular php, but not in scriptcase. Why? How can I suppress the error when something goes wrong?
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

  • #2
    I think that sc has it's own handler but does not do it the php advised way as described on http://php.net/manual/en/language.op...rorcontrol.php ??
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Ok, restore_error_handler () does it. But I recommend to change the core to handle issues like this correctly
      Albert Drent
      aducom software netherlands
      scriptcase partner, reseller, support and (turn-key) development
      www.scriptcase.eu / www.scriptcase.nl

      Comment


      • #4
        Hi Albert.

        I am having the same problem with @file_get_contents. I've used restore_error_handler(), which works fine. However, do you know how to set things back to use the Scriptcase error handling afterward?

        ​Thanks very much.

        Jeff

        Comment


        • #5
          don't know if it applies, but when I had to avoid SC ouputting errors that messed up an ajax return value, I did this in a blank app:

          Code:
          ob_start();
            commands that throws errors I don't want to see;
            ..;
          ob_end_clean();
          Last edited by robydago; 03-07-2016, 01:49 PM.

          Comment


          • #6
            Thanks robydago. I will look into that approach. I was thinking that we could simply issue a set_error_handler("xxx") but I don't know what xxx should be.

            Comment


            • #7
              If someone from Scriptcase can please advise re aducom's question above about the SC error handling? That would help us here too.
              Thanks
              )

              Comment

              Working...
              X