Fix: Better error management
This commit is contained in:
parent
88e39bbb22
commit
e61ec60188
@ -753,7 +753,8 @@ class ActionComm
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFailedToWriteFile",$outputfile);
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans("ErrorFailToCreateFile",$outputfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -18,10 +18,10 @@
|
||||
|
||||
|
||||
/**
|
||||
\file htdocs/lib/xcal.lib.php
|
||||
\brief Function to manage calendar files (vcal/ical/...)
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/lib/xcal.lib.php
|
||||
* \brief Function to manage calendar files (vcal/ical/...)
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Build a file from an array of events
|
||||
@ -211,7 +211,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("xcal.lib.php::build_cal_file Failed to open file ".$outputfile." for writing");
|
||||
dol_syslog("xcal.lib.php::build_calfile Failed to open file ".$outputfile." for writing");
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,6 +128,12 @@ if ($format == 'ical' || $format == 'vcal')
|
||||
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'Error '.$agenda->error;
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($format == 'rss')
|
||||
@ -159,6 +165,12 @@ if ($format == 'rss')
|
||||
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'Error '.$agenda->error;
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user