Announcement

Collapse
No announcement yet.

Cannot suppress errors...

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

  • aducom
    started a topic Cannot suppress errors...

    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?

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

    Leave a comment:


  • bdl
    replied
    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.

    Leave a comment:


  • robydago
    replied
    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.

    Leave a comment:


  • bdl
    replied
    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

    Leave a comment:


  • aducom
    replied
    Ok, restore_error_handler () does it. But I recommend to change the core to handle issues like this correctly

    Leave a comment:


  • aducom
    replied
    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 ??

    Leave a comment:

Working...
X