1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.utils.ui;
14 import org.simantics.utils.ui.dialogs.ShowError;
19 * @author Toni Kalajainen
21 public class ExceptionUtils {
23 public static void logWarning(String msg) {
24 Exception e = new Exception(msg);
25 ErrorLogger.getDefault().logWarning(msg, e);
28 public static void logWarning(String msg, Throwable e) {
29 e = new Exception(msg, e);
30 ErrorLogger.getDefault().logWarning(msg, e);
33 public static void logError(Throwable e) {
34 ErrorLogger.defaultLogError(e);
37 public static void logError(String msg, Throwable e) {
38 e = new Exception(msg, e);
39 ErrorLogger.getDefault().logError(msg, e);
42 public static void logAndShowError(Throwable e) {
43 ErrorLogger.defaultLogError(e);
44 ShowError.showError("Error", e.getMessage(),e);
47 public static void logAndShowError(String message, Throwable e) {
48 ErrorLogger.defaultLogError(message,e);
49 ShowError.showError("Error", message,e);
52 public static void logAndShowError(String title, String message, Throwable e) {
53 ErrorLogger.defaultLogError(message,e);
54 ShowError.showError(title, message,e);
57 public static void showError(Throwable e) {
58 ShowError.showError("Error", e.getMessage(),e);
61 public static void showError(String message, Throwable e) {
62 ShowError.showError("Error", message,e);