Fix: Better error management

This commit is contained in:
Laurent Destailleur 2010-01-17 19:54:33 +00:00
parent 88e39bbb22
commit e61ec60188
3 changed files with 55 additions and 42 deletions

View File

@ -753,7 +753,8 @@ class ActionComm
if ($result < 0) if ($result < 0)
{ {
$this->error=$langs->trans("ErrorFailedToWriteFile",$outputfile); $langs->load("errors");
$this->error=$langs->trans("ErrorFailToCreateFile",$outputfile);
} }
} }

View File

@ -18,10 +18,10 @@
/** /**
\file htdocs/lib/xcal.lib.php * \file htdocs/lib/xcal.lib.php
\brief Function to manage calendar files (vcal/ical/...) * \brief Function to manage calendar files (vcal/ical/...)
\version $Id$ * \version $Id$
*/ */
/** /**
* \brief Build a file from an array of events * \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 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; return -2;
} }
} }

View File

@ -128,6 +128,12 @@ if ($format == 'ical' || $format == 'vcal')
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
exit; exit;
} }
else
{
print 'Error '.$agenda->error;
exit;
}
} }
if ($format == 'rss') if ($format == 'rss')
@ -159,6 +165,12 @@ if ($format == 'rss')
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
exit; exit;
} }
else
{
print 'Error '.$agenda->error;
exit;
}
} }