001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.osm; 003 004/** 005 * Exception thrown when a primitive or data set does not pass its integrity checks. 006 * @since 2399 007 */ 008public class DataIntegrityProblemException extends RuntimeException { 009 010 private final String htmlMessage; 011 012 /** 013 * Constructs a new {@code DataIntegrityProblemException}. 014 * @param message the detail message 015 */ 016 public DataIntegrityProblemException(String message) { 017 this(message, null); 018 } 019 020 /** 021 * Constructs a new {@code DataIntegrityProblemException}. 022 * @param message the detail message 023 * @param htmlMessage HTML-formatted error message. Can be null 024 */ 025 public DataIntegrityProblemException(String message, String htmlMessage) { 026 super(message); 027 this.htmlMessage = htmlMessage; 028 } 029 030 /** 031 * Returns the HTML-formatted error message. 032 * @return the HTML-formatted error message, or null 033 */ 034 public String getHtmlMessage() { 035 return htmlMessage; 036 } 037}