Ilya A. Volynets-Evenbakh wrote:
On one hand using standard C++ exceptions where possible makes sense. On the other hand, it introduces naming inconsistencies, because some exceptions have no analogues (think IllegalStateException when setting headers in committed output stream). I think best approach is combined one: simply derive from standard exceptions where possible, (or even create typedefs), and still throw by Java name. This way both C++ programmers, and those switching from Java will have what they need. Side benefit of having all Java exception names available is easier possibility of automagic Java servlet to C++ servlet translation (I know it's far off goal, but one day we might come up with the tool ;-)
You're right. Deriving from std or typedefing is a good idea. I'm for it.
Krzysztof Rzymkowski wrote:Ilya A. Volynets-Evenbakh wrote:I am yet again restarting the API conversion process, and yet another question pops up. Current cxxsp API does not define standard servlet exceptions, even though it lists them in docs as being thrown. Shall we fix documentation or the code?The docs were copied almost as is from the JavaServlet API. I think we should fix both the code and docs. We should use standard C++ exception where possible (e.g. std::invalid_argument instead of IllegalArgumentException) I should spent some time on the API docs, but that's such a boring task, that I can't make myself do it ;p Cheers Chris http://cxxsp.sf.net
Authoright © Total Knowledge: 2001-2008