[eluser]billmce[/eluser]
I have a curl routine in my model.
If the destination site isn't available I get the following error returned and the application dies.
Quote:Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\cif\application\libraries\Curl.php on line 255
I don't seem to be able to catch this error at the codeigniter level.
I'm looking for a more elegant solution.
Because the model isn't returning valid data I know 'something is wrong' and tried to handle it with a view indicating a problem .... but the codeigniter commands don't work after this error ... so I resorted to the echo's shown.
Code:
if($ticket == "<" or $ticket == '')
{
//the echo statements show ... but the codeigniter stuff does not
echo "Unable to reach the Document Management System.<br />";
echo "Please alert the System Administrator.<br />";
echo "To continue ... without access to documents ... hit the 'BACK' button of your browser";
//we have to do something here ... send to a odd page,
// or don't bring up the upload section show "not available" ... yeah
// do the same for the search parts.
// redirect to error page.
$data['error_msg'] = 'Unable to contact Document Management System.<br />';
$data['error_msg'] .= 'Please contact System Administrator.<br />';
// 'return to' link on error view and as redirect
$data['return_page']=current_url();
$data['redirect_to'] = current_url();
$data['robots'] = '<meta name="robots" content="noindex,nofollow">';
$data['title']="System Error"; //shows up on tab
$data['pagetitle']="Network Issue -- Document Management System"; //top of page body
$this->load->view('header_view',$data);
$this->load->view('menu_view');
$this->load->view('form_error_view', $data);
$this->load->view('footer_view',$data);
}
Is there a better way of handling errors from libraries?
TIA