Hi,
what if an SQLException occurrs on the server?
in MyServiceImpl.java:
public boolean saveRecord (Record rec) // throws Exception
{
try
{
dbs.saveUser (usr);
}
catch (SQLException e)
{
// create MyException and throw it?
}
return (true);
}
Should I define an own Exception type or can I pass SQLException over
RPC somehow?
Thanks
Magnus
On Jul 5, 10:24 pm, andreas <[email protected]> wrote:
> From what I know you can use any type of exception, but:
>
> - GWT needs to know the source (file) of the exception (it's either in
> an inherited module or in your 'client' code or what ever package you
> declared in your *.gwt.xml)
> - it needs to be serializable (implement Serializable and do not
> forget empty constructor)
>
> That's it I think.
>
> Andreas
>
> On 5 Jul., 18:55, Magnus <[email protected]> wrote:
>
> > Hi,
>
> > I am trying to implement an RPC call that loads a record from a
> > database:
>
> > User loadUser (String nickname) throws Exception;
>
> > I tried different Exception types:
>
> > SQLException: results in mystic errors (not serializable)
> > Exception: results in error "uncaught exception" at the service call
> > IllegalArgumentException: works, but is not that what I want
>
> > Question 1:
> > What Exception types may be used for RPC?
>
> > Question 2:
> > Where (which source files) do I have to declare the exception?
> > Service
> > ServiceAsync
> > ServiceImpl
>
> > Thanks
> > Magnus
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.