X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.utils.ui%2Fsrc%2Forg%2Fsimantics%2Futils%2Fui%2FExceptionUtils.java;h=c744cc4752bb779bb3fda21612c5a1640ba43bc9;hb=b7250834202635a09dd18e25370ed9b4c32b1380;hp=42526b898fd7b990aa482c68469e1d913d085d25;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/ExceptionUtils.java b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/ExceptionUtils.java index 42526b898..c744cc475 100644 --- a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/ExceptionUtils.java +++ b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/ExceptionUtils.java @@ -1,65 +1,65 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.utils.ui; - -import org.simantics.utils.ui.dialogs.ShowError; - - -/** - * - * @author Toni Kalajainen - */ -public class ExceptionUtils { - - public static void logWarning(String msg) { - Exception e = new Exception(msg); - ErrorLogger.getDefault().logWarning(msg, e); - } - - public static void logWarning(String msg, Throwable e) { - e = new Exception(msg, e); - ErrorLogger.getDefault().logWarning(msg, e); - } - - public static void logError(Throwable e) { - ErrorLogger.defaultLogError(e); - } - - public static void logError(String msg, Throwable e) { - e = new Exception(msg, e); - ErrorLogger.getDefault().logError(msg, e); - } - - public static void logAndShowError(Throwable e) { - ErrorLogger.defaultLogError(e); - ShowError.showError("Error", e.getMessage(),e); - } - - public static void logAndShowError(String message, Throwable e) { - ErrorLogger.defaultLogError(message,e); - ShowError.showError("Error", message,e); - } - - public static void logAndShowError(String title, String message, Throwable e) { - ErrorLogger.defaultLogError(message,e); - ShowError.showError(title, message,e); - } - - public static void showError(Throwable e) { - ShowError.showError("Error", e.getMessage(),e); - } - - public static void showError(String message, Throwable e) { - ShowError.showError("Error", message,e); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.utils.ui; + +import org.simantics.utils.ui.dialogs.ShowError; + + +/** + * + * @author Toni Kalajainen + */ +public class ExceptionUtils { + + public static void logWarning(String msg) { + Exception e = new Exception(msg); + ErrorLogger.getDefault().logWarning(msg, e); + } + + public static void logWarning(String msg, Throwable e) { + e = new Exception(msg, e); + ErrorLogger.getDefault().logWarning(msg, e); + } + + public static void logError(Throwable e) { + ErrorLogger.defaultLogError(e); + } + + public static void logError(String msg, Throwable e) { + e = new Exception(msg, e); + ErrorLogger.getDefault().logError(msg, e); + } + + public static void logAndShowError(Throwable e) { + ErrorLogger.defaultLogError(e); + ShowError.showError("Error", e.getMessage(),e); + } + + public static void logAndShowError(String message, Throwable e) { + ErrorLogger.defaultLogError(message,e); + ShowError.showError("Error", message,e); + } + + public static void logAndShowError(String title, String message, Throwable e) { + ErrorLogger.defaultLogError(message,e); + ShowError.showError(title, message,e); + } + + public static void showError(Throwable e) { + ShowError.showError("Error", e.getMessage(),e); + } + + public static void showError(String message, Throwable e) { + ShowError.showError("Error", message,e); + } + +}