001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.tools; 003 004/** 005 * JOSM runtime exception. 006 * @since 11374 007 */ 008public class JosmRuntimeException extends RuntimeException { 009 010 /** 011 * Constructs a new {@code JosmRuntimeException} with the specified detail message. 012 * The cause is not initialized, and may subsequently be initialized by a call to {@link #initCause}. 013 * 014 * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method. 015 */ 016 public JosmRuntimeException(String message) { 017 super(message); 018 } 019 020 /** 021 * Constructs a new {@code JosmRuntimeException} with the specified cause and a detail message of 022 * <code>(cause==null ? null : cause.toString())</code> (which typically contains the class and detail message of <code>cause</code>). 023 * This constructor is useful for runtime exceptions that are little more than wrappers for other throwables. 024 * 025 * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). 026 */ 027 public JosmRuntimeException(Throwable cause) { 028 super(cause); 029 } 030 031 /** 032 * Constructs a new {@code JosmRuntimeException} with the specified detail message and cause.<p> 033 * Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated in this exception's detail message. 034 * 035 * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method). 036 * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). 037 */ 038 public JosmRuntimeException(String message, Throwable cause) { 039 super(message, cause); 040 } 041 042 /** 043 * Constructs a new runtime exception with the specified detail message, cause, 044 * suppression enabled or disabled, and writable stack trace enabled or disabled. 045 * 046 * @param message the detail message 047 * @param cause the cause 048 * @param enableSuppression whether or not suppression is enabled or disabled 049 * @param writableStackTrace whether or not the stack trace should be writable 050 */ 051 public JosmRuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 052 super(message, cause, enableSuppression, writableStackTrace); 053 } 054}