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?

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.operators.errorcontrol.php ??

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

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

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:

ob_start();
[I]  commands that throws errors I don't want to see;
  ..;[/I]
ob_end_clean();

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.

If someone from Scriptcase can please advise re @aducom’s question above about the SC error handling? That would help us here too.
Thanks
:o)