Closed Bug 451453 Opened 17 years ago Closed 17 years ago

[silme] (file.py) log instead of raise an exception in FileClient.getSource()

Categories

(Mozilla Localizations :: Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: adriank, Assigned: adriank)

Details

Attachments

(1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
It is not possible to override this exception if getSource() has been called from another method inside Silme. And without that you can currently only override the exception of the whole method, e.g. getL10nLocales(), which causes a lot of trouble. With the patch attached we can log the exception without breaking the methods calling getSource().
Attachment #334773 - Flags: review?(gandalf)
The patch looks good. What worries me is that it adds a new dependency very much in the middle of the library. I have been trying to avoid thinking about logging solution but I know we'll have to face it. logging sounds like a default python package for that, so the whole concept makes sense, it's just that I have no experience with this... Pike - your opinion?
It could be very useful to have error list for each l10nPackage, eg like l10nPackage.errors[file][type|path|msg] so we could easily reuse such information with diff, tests or reporting.
What Stefan said. In my compare-locales, I'm reporting parsing errors (grammar or encoding alike) on the same level as I report diffs.
Stef, Axel: I like this idea. Lets see how it can be done...
the only design choice we have to make is wherever we want to attach errors/exceptions/problems to l10nObject/l10nPackage or to external object. I'm a little bit worried about the sanity of the API if we'll try to mix such informations into l10nPackage so automatically I'd prefer to get it externally from l10nPackage. For example we could extend logger to store any errors per package. Pike? Stef? Adrian?
As I see this we need an easy way to handle reader errors - eg when I iterate through objects/packages in subL10nPackage I need to know what parts of file set (like images) vaporized - I consider such information as critical for reliability. If we really don't want to store such information directly in l10nPackage I would like to have getL10nPackageErrors(l10nPakcakge) method that will return all errors info (not recursively, all errors set is last thing that I want to deal with) and have option for not logging to file.
Attachment #334773 - Attachment is obsolete: true
Attachment #334773 - Flags: review?(gandalf)
the Problem will be solved in a different way (keywords: logger/logging)
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: