service.getShapes(dbName, new AsyncCallback() { public void onSuccess(Shape[] result) { // It's always safe to downcast to the known return type. controller.processShapes(result); } public void onFailure(Throwable caught) { // Convenient way to find out which exception was thrown. try { throw caught; } catch (IncompatibleRemoteServiceException e) { // this client is not compatible with the server; cleanup and refresh the // browser } catch (InvocationException e) { // the call didn't complete cleanly } catch (ShapeException e) { // one of the 'throws' from the original method } catch (DbException e) { // one of the 'throws' from the original method } catch (Throwable e) { // last resort -- a very unexpected exception } }
onfail
最新推荐文章于 2022-01-30 13:47:34 发布