• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java UmbrellaException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.web.bindery.event.shared.UmbrellaException的典型用法代码示例。如果您正苦于以下问题:Java UmbrellaException类的具体用法?Java UmbrellaException怎么用?Java UmbrellaException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UmbrellaException类属于com.google.web.bindery.event.shared包,在下文中一共展示了UmbrellaException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: logException

import com.google.web.bindery.event.shared.UmbrellaException; //导入依赖的package包/类
private void logException(Throwable t, boolean isCause) {
  String msg = t.toString();
  if (isCause) {
    msg = "caused by: " + msg;
  }
  groupStart(msg);
  log(t);
  if (t instanceof UmbrellaException) {
    UmbrellaException umbrella = (UmbrellaException) t;
    for (Throwable cause : umbrella.getCauses()) {
      logException(cause, true);
    }
  } else if (t.getCause() != null) {
    logException(t.getCause(), true);
  }
  groupEnd();
}
 
开发者ID:hugzhorolo,项目名称:gwt-formlayout,代码行数:18,代码来源:SuperDevModeUncaughtExceptionHandler.java


示例2: log

import com.google.web.bindery.event.shared.UmbrellaException; //导入依赖的package包/类
private static void log( @Nonnull final Throwable t, final boolean isCause )
{
  final String msg = ( isCause ? "caused by: " : "" ) + t;
  _groupStart( msg );
  _log( t );
  if ( t instanceof UmbrellaException )
  {
    final UmbrellaException umbrella = (UmbrellaException) t;
    for ( final Throwable cause : umbrella.getCauses() )
    {
      log( cause, true );
    }
  }
  else if ( null != t.getCause() )
  {
    log( t.getCause(), true );
  }
  _groupEnd();
}
 
开发者ID:realityforge,项目名称:gwt-lognice,代码行数:20,代码来源:BrowserExceptionUtil.java


示例3: unwrap

import com.google.web.bindery.event.shared.UmbrellaException; //导入依赖的package包/类
private static Throwable unwrap(Throwable e) {
    if (e instanceof UmbrellaException) {
        UmbrellaException ue = (UmbrellaException) e;
        if (ue.getCauses().size() == 1)
            return unwrap(ue.getCauses().iterator().next());
    }
    return e;
}
 
开发者ID:GwtDomino,项目名称:domino,代码行数:9,代码来源:RestfulRemoteLogHandler.java


示例4: onUncaughtException

import com.google.web.bindery.event.shared.UmbrellaException; //导入依赖的package包/类
@Override
public void onUncaughtException(Throwable e) {
	GWT.log("Unexpected exception", e);
	
	if(e instanceof UmbrellaException) {
		UmbrellaException umbrellaException = (UmbrellaException)e;
		if(umbrellaException.getCause() != null) {
			e = umbrellaException.getCause();
		}
		if(umbrellaException.getCauses() != null) {
			for(Throwable cause : umbrellaException.getCauses()) {
				if(cause instanceof StatusCodeException) {
					e = cause;
					break;
				}
			}
		}
	}
	
	if(e instanceof StatusCodeException) {
		StatusCodeException statusCodeException = (StatusCodeException)e;
		if(statusCodeException.getStatusCode() == 401 
				|| statusCodeException.getStatusCode() == 403) {
			errorLabel.setText("Unauthorized");
		} else {
			errorLabel.setText("HTTP status error: " + statusCodeException.getStatusCode());
		}
	} else {
		errorLabel.setText(e.getMessage());
	}
	dialogBox.center();
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:33,代码来源:ErrorView.java


示例5: unwrapUmbrellaException

import com.google.web.bindery.event.shared.UmbrellaException; //导入依赖的package包/类
public static Throwable unwrapUmbrellaException(Throwable e) {
    if (e instanceof UmbrellaException) {
        UmbrellaException ue = (UmbrellaException) e;
        if (ue.getCauses().size() == 1) {
            return unwrapUmbrellaException(ue.getCauses().iterator().next());
        }
    }
    return e;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:10,代码来源:GwtUtil.java


示例6: run

import com.google.web.bindery.event.shared.UmbrellaException; //导入依赖的package包/类
@Override
public void run() {

    /* Add handlers, setup activities */
    GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {

        @Override
        public void onUncaughtException(Throwable e) {

            /* open the umbrella if it's an umbrella */
            e = unwrapException(e);

            e.printStackTrace();
            LOG.log(Level.SEVERE, "Uncaught exception", e);
        }

        private static final int MAX_UNWRAPS = 10;

        private Throwable unwrapException(Throwable throwable) {

            Throwable result = throwable;
            int attempts = 0;

            while (attempts < MAX_UNWRAPS) {

                if (result instanceof UmbrellaException && ((UmbrellaException) result).getCauses().size() == 1) {
                    result = ((UmbrellaException) throwable).getCauses().iterator().next();
                } else if (result instanceof com.google.web.bindery.event.shared.UmbrellaException
                        && ((com.google.web.bindery.event.shared.UmbrellaException) result).getCauses().size() == 1) {
                    result = ((com.google.web.bindery.event.shared.UmbrellaException) throwable).getCauses()
                            .iterator().next();
                } else {
                    break;
                }

                attempts++;
            }
            return result;
        }
    });

    /* activity management */
    CachingActivityMapper cached = new CachingActivityMapper(mainActivityMapper);
    ActivityManager mainActivityManager = new ActivityManager(cached, eventBus);
    mainActivityManager.setDisplay(applicationActivity.getViewPanel());

    /* add a panel for the desktop to add to if it needs to */
    SimpleLayoutPanel sp = new SimpleLayoutPanel();
    RootLayoutPanel.get().add(sp);

    applicationActivity.start(sp, eventBus);
}
 
开发者ID:pillingworthz,项目名称:ifictionary,代码行数:53,代码来源:ZaxApplicationController.java



注:本文中的com.google.web.bindery.event.shared.UmbrellaException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AutomationContext类代码示例发布时间:2022-05-22
下一篇:
Java CallbackRegistry类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap