Andreas Hartmann wrote:

Michael Wechner wrote:

[...]

Do you think it's a "potentially harmful situation" if the method existsInAnyLanguage() returns false?


false, there is no language version and I think this should be indicated by at least a WARNING


No, that's not the case. The check for the existing language version
implicates that the caller is aware of the case that the language
version does not exist. This method could be called, for instance, to
enable / disable the "Create language version" menu item.


IMHO, only the caller of this method can determine whether the result
(true or false) is harmful for the application. For the method itself,
either result is fine.


I totally agree to Josias.


the problem I see is that the DefaultDocument is an implementation and if the implementation itself does not throw a WARNING or an ERROR, but only higher up, then it's very hard to debug
where the actually problem is located.


I don't understand this implication. You throw an exception when a
problem occurs. Why should you log a warning if the caller might
interpret the result of this method as a problem? Then you could
log warnings in virtually every line of the code.


I am not talking about logging warnings for every line, but for particular cases.

Lenya currently sends you a message in the sense "no such document" which really sucks,
because it gives you no clue why there is no such document.

Is it a problem of the particular SiteManager? is it a problem of the particular Repository?
Is it a problem of the SourceImplementation?

In the case of more complex resource types this can become even more annoying ...

I have spent a lot of time over the last couple of days to figure out current bugs and just because the logging sucks. Just wait until you will spend time on this ;-)

Also consider that in productive environments it will be even more a problem.

Or do you really want to end up with something like:


"Unexpected System Failure" (go ask your admin)

?

I don't and I don't understand at all why a lot of software has such crappy behaviour.
I think we should make Lenya a good exception to this rule of bad behaviour.

Michi




If one would throw a stacktrace then it should be alright,
but so far we don't log stacktraces for WARNINGS.


If an exception is thrown, a stack trace is logged.

-- Andreas




--
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                        [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to