GNOME Bugzilla – Bug 662792
OnlineGlom: Improve error messages when servlet has not been configured correctly
Last modified: 2011-11-25 20:48:44 UTC
Instead of displaying this in the browser: Unable to communicate with the server. Check the error log for more information. It could display error messages like this: - The directory was found, but there are no files there. - The directory was found, but these files were not recognized as .glom files: yadda.something, etc. - The directory was found, but we do not have permission to list the directory contents. - The directory was found, but we do not have permission to read these files: yadda.something, etc.
The servlet initialization code has been moved from the constructor to the overridden init() method with these commits: https://gitorious.org/online-glom/gwt-glom/commit/c30465d6826efbbe8870bf020a1c907486a3191b https://gitorious.org/online-glom/gwt-glom/commit/4ed6d81dabd9a0167d59a2f739325eb8c8398bfb This is half of the solution to getting proper error messages displayed when configuration errors occur. The rest of the solution involves surrounding the body of the init() method with a try/catch block and setting a global variable with the error / exception. A new async method should be created to retrieve and display the error message / exception.
(In reply to comment #1) > The rest of the solution involves surrounding the body of the init() method > with a try/catch block and setting a global variable with the error / > exception. A new async method should be created to retrieve and display the > error message / exception. Will that global variable be per-session only? I mean, would user A get user B's error message?
Also, shouldn't that "Unable to communicate with the server. Check the error log for more information." error message really read "Unable to find Glom documents on the server." or does it really have something to do with the PostgreSQL server?
(In reply to comment #2) > Will that global variable be per-session only? I mean, would user A get user > B's error message? Since we're talking about servlet configuration errors, all users should get the same error message. Errors encountered during operation should be handled by throwing exceptions in servlet methods that are called by the client code (i.e. not the init() method). These exceptions would then be caught in the client side code which will make them per-user because they're based on specific method calls from a client. We don't have proper session support on the server yet. (In reply to comment #3) > Also, shouldn't that "Unable to communicate with the server. Check the error > log for more information." error message really read "Unable to find Glom > documents on the server." or does it really have something to do with the > PostgreSQL server? It's trying to say that the client code can't talk to the server code. "the server" refers to the servlet, not the the PostgreSQL server. You'd get this error with a problem finding the document and a PostgreSQL configuration problem. Things will be more clear when I fix this.
This is fixed with these commits: https://gitorious.org/online-glom/gwt-glom/commit/045c81d200d27db6db17ea512fe1ef6fcdfd9417 https://gitorious.org/online-glom/gwt-glom/commit/55b71839aae249bb5ec8c1deda619c9d5b32d6f0