001 /* 002 * file StpMessageException.java 003 * 004 * (C) Copyright IBM Corporation 2008, 2014. All Rights Reserved. 005 * Note to U.S. Government Users Restricted Rights: Use, duplication or 006 * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 007 * 008 * The source code for this program is not published or otherwise 009 * divested of its trade secrets, irrespective of what has been 010 * deposited with the U.S. Copyright Office. 011 */ 012 013 package com.ibm.rational.wvcm.stp; 014 015 import javax.wvcm.Resource; 016 import javax.wvcm.ResourceList; 017 import javax.wvcm.WvcmException.ReasonCode; 018 019 import com.ibm.rational.wvcm.stp.StpPartialResultsException.PartialResultsData; 020 import com.ibm.rational.wvcm.stp.StpPropertyException.PropertyData; 021 022 /** 023 * An StpException used to pass an error message string generated by the domain 024 * application through the CM API without further adornment. 025 */ 026 public abstract class StpErrorMessageException extends StpPropertyException 027 { 028 /** 029 * @return The message string exactly as generated by the domain application 030 * without the additional context information provided by the server 031 * or client libraries when forming the string returned by the 032 * toString, getMessage or getLocalizedMessage methods of this 033 * Throwable object. 034 */ 035 public String errorMessage() 036 { 037 return ((ErrorMessageData)data()).errorMessage(); 038 } 039 040 /* 041 * @param resource 042 * @param reasonCode 043 * @param nestedExceptions 044 */ 045 protected StpErrorMessageException(Resource resource, 046 ReasonCode reasonCode, 047 Throwable... nestedExceptions) 048 { 049 super(resource, reasonCode, nestedExceptions); 050 } 051 052 /** 053 * The interface for the data implementation object for this type of 054 * exception 055 */ 056 public interface ErrorMessageData extends PropertyData { 057 public String errorMessage(); 058 } 059 }