Code Repositories xandikos / 194bf7e
Provide details when failing to parse a ics/vcf file. Should help in debugging #80 Jelmer Vernooń≥ 2 months ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
132132 (name, etag) = self.store.import_one(
133133 self.name, self.content_type, data,
134134 replace_etag=extract_strong_etag(replace_etag))
135 except InvalidFileContents:
135 except InvalidFileContents as e:
136136 # TODO(jelmer): Not every invalid file is a calendar file..
137137 raise webdav.PreconditionFailure(
138138 '{%s}valid-calendar-data' % caldav.NAMESPACE,
139 'Not a valid calendar file.')
139 'Not a valid calendar file: %s' % e.error)
140140 except DuplicateUidError:
141141 raise webdav.PreconditionFailure(
142142 '{%s}no-uid-conflict' % caldav.NAMESPACE,
279279 def create_member(self, name, contents, content_type):
280280 try:
281281 (name, etag) = self.store.import_one(name, content_type, contents)
282 except InvalidFileContents:
282 except InvalidFileContents as e:
283283 # TODO(jelmer): Not every invalid file is a calendar file..
284284 raise webdav.PreconditionFailure(
285285 '{%s}valid-calendar-data' % caldav.NAMESPACE,
286 'Not a valid calendar file.')
286 'Not a valid calendar file: %s' % e.error)
287287 except DuplicateUidError:
288288 raise webdav.PreconditionFailure(
289289 '{%s}no-uid-conflict' % caldav.NAMESPACE,