propagate libical errors through the ics service.

part of bug 306508, r=dmose
This commit is contained in:
mvl%exedo.nl 2005-09-30 17:09:38 +00:00
Родитель dbe0e5f3c3
Коммит 4d948b90bd
2 изменённых файлов: 25 добавлений и 1 удалений

Просмотреть файл

@ -61,5 +61,26 @@ interface calIErrors : nsISupports
* An invalid or nonexistent timezone was encountered.
*/
const unsigned long INVALID_TIMEZONE = ERROR_BASE + 1;
/* ICS specific errors */
const unsigned long ICS_ERROR_BASE = ERROR_BASE + 0x100;
/**
* ICS errors, copied from icalerror.h.
* The numbers (minus ICS_ERROR_BASE) should match with the enum
* values from icalerror.h
*/
const unsigned long ICS_NO_ERROR = ICS_ERROR_BASE + 0;
const unsigned long ICS_BADARG = ICS_ERROR_BASE + 1;
const unsigned long ICS_NEWFAILED = ICS_ERROR_BASE + 2;
const unsigned long ICS_ALLOCATION = ICS_ERROR_BASE + 3;
const unsigned long ICS_MALFORMEDDATA = ICS_ERROR_BASE + 4;
const unsigned long ICS_PARSE = ICS_ERROR_BASE + 5;
const unsigned long ICS_INTERNAL = ICS_ERROR_BASE + 6;
const unsigned long ICS_FILE = ICS_ERROR_BASE + 7;
const unsigned long ICS_USAGE = ICS_ERROR_BASE + 8;
const unsigned long ICS_UNIMPLEMENTED = ICS_ERROR_BASE + 9;
const unsigned long ICS_UNKNOWN = ICS_ERROR_BASE + 10;
};

Просмотреть файл

@ -49,6 +49,7 @@
#include "calIEvent.h"
#include "calBaseCID.h"
#include "calIErrors.h"
static NS_DEFINE_CID(kCalICSService, CAL_ICSSERVICE_CID);
@ -964,7 +965,9 @@ calICSService::ParseICS(const nsACString& serialized,
PromiseFlatCString(serialized).get(), icalerrno,
icalerror_strerror(icalerrno));
#endif
return NS_ERROR_FAILURE;
// The return values is calIError match with ical errors,
// so no need for a conversion table or anything.
return calIErrors::ICS_ERROR_BASE + icalerrno;
}
calIcalComponent *comp = new calIcalComponent(ical, nsnull);
if (!comp) {