Numerical Error Messages and Warnings

Started by Mac2, October 05, 2011, 11:35:07 AM

Previous topic - Next topic

Mac2

ExifTool emits error messages and warnings via stderr and we can catch these messages with little effort when using the exiftool.exe from other applications.

Processing these textual messages and find the appropriate actions is more difficult. I currently do string compares / greps to detect certain errors/warnings and handle them. Luckily error messages are not (yet) localized and you don't change them often (or at all).

I have looked at the source code and I know that the error messages are spread all over the code. So this might be a stretch  :-[
But would it be thinkable (very low on your list) to append some sort of unique number to each warning/error message?

Like changing

Error opening c:\images\bla.jpg for writing

into

Error opening c:\images\bla.jpg for writing [5]

It would be safer and more reliable to parse for the numerical error code "5" at the end of the message instead of doing text compares.

Phil Harvey

Thanks for the suggestion.

This feature would be easy to add at the same time as I add support for localized error strings, so I will tie it to this feature request (which is currently number 124 on the to-do list -- still a long, long way off).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mac2

Ah, well. Localizing the error messages would make it even harder to handle them in an application. So this will fit nicely together.

Quotewhich is currently number 124 on the to-do list
Aaahh, isn't it nice to know exactly what to do with all these rainy boring evenings without anything on the telly?  ::)
(From a programmer spending a large share of his spare time developing applications and tools for others)

Phil Harvey

Just a heads up:

I have had a request to change one of the warning messages.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mac2

Oh. What joy awaits when you ever consider localizing all these messages  :)

Phil Harvey

Exactly.  Truth be told I had already implemented localized warning/error messages in a test version of ExifTool, but scrapped the feature without releasing it for reasons like this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).