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 009package com.ibm.rational.wvcm.stp; 010 011import javax.wvcm.Resource; 012import javax.wvcm.ResourceList; 013import javax.wvcm.WvcmException.ReasonCode; 014 015import com.ibm.rational.wvcm.stp.StpPartialResultsException.PartialResultsData; 016import com.ibm.rational.wvcm.stp.StpPropertyException.PropertyData; 017 018/** 019 * An StpException used to pass an error message string generated by the domain 020 * application through the CM API without further adornment. 021 */ 022public abstract class StpErrorMessageException extends StpPropertyException 023{ 024 /** 025 * @return The message string exactly as generated by the domain application 026 * without the additional context information provided by the server 027 * or client libraries when forming the string returned by the 028 * toString, getMessage or getLocalizedMessage methods of this 029 * Throwable object. 030 */ 031 public String errorMessage() 032 { 033 return ((ErrorMessageData)data()).errorMessage(); 034 } 035 036 /* 037 * @param resource 038 * @param reasonCode 039 * @param nestedExceptions 040 */ 041 protected StpErrorMessageException(Resource resource, 042 ReasonCode reasonCode, 043 Throwable... nestedExceptions) 044 { 045 super(resource, reasonCode, nestedExceptions); 046 } 047 048 /** 049 * The interface for the data implementation object for this type of 050 * exception 051 */ 052 public interface ErrorMessageData extends PropertyData { 053 public String errorMessage(); 054 } 055}