Hi. I am trying to send a personal exception from server to client
side, following the steps described in this thread
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/c03fc4cf1efbc849/c5c297bfe8d99922?lnk=gst&q=exception#c5c297bfe8d99922
but is not working for me.
Whatever i do, I allways get the same error in client side,
"com.google.gwt.user.client.rpc.StatusCodeException: The call failed
on the server; see server log for details"
Let me show you my code:
Server side service:
public void saveFiscalYear(FiscalYear newFiscalyear)
throws Exception,DuplicateFiscalYearException {
// Some code to verify if the fiscal year exists in the database
try {
fiscalYearManager.save(newFiscalyear);
} catch (Exception e) {
if (e instanceof DuplicateFiscalYearException) {
DuplicateFiscalYearException personalException
= new
DuplicateFiscalYearException();
throw personalException;
}
throw new Exception("exception", e);
}
My personal exception code:
public class DuplicateFiscalYearException extends
SerializationException implements IsSerializable{
public DuplicateFiscalYearException() {
super();
}
public DuplicateFiscalYearException(String msg, Throwable cause) {
super(msg, cause);
}
public DuplicateFiscalYearException(String msg) {
super(msg);
}
public EjercicioDuplicadoException(Throwable cause) {
super(cause);
}
}
And my client side code:
service.saveFiscalYear(fiscalYear, new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
Exception capture=(Exception)caught;
if(capture instanceof
DuplicateFiscalYearException){
box.close();
MessageBox.alert(localiced.titleError(),
"Duplicated fiscal
year",
null);
}
else
{
box.close();
MessageBox.alert(localiced.titleError(),
"Error while creating
fiscal year",
null);
}
}
Can anybody help me? Thank you in advance.
--
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.