After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662792 - OnlineGlom: Improve error messages when servlet has not been configured correctly
OnlineGlom: Improve error messages when servlet has not been configured corre...
Status: RESOLVED FIXED
Product: glom
Classification: Other
Component: OnlineGlom
git master
Other Linux
: Normal normal
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on:
Blocks:
 
 
Reported: 2011-10-26 18:32 UTC by Ben Konrath
Modified: 2011-11-25 20:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ben Konrath 2011-10-26 18:32:07 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.
Comment 1 Ben Konrath 2011-10-26 19:00:42 UTC
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.
Comment 2 Murray Cumming 2011-10-31 11:46:25 UTC
(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?
Comment 3 Murray Cumming 2011-10-31 11:48:46 UTC
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?
Comment 4 Ben Konrath 2011-10-31 13:57:18 UTC
(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.