001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018package org.apache.log4j.config; 019 020/** 021 * Thrown when an error is encountered whilst attempting to set a property 022 * using the {@link PropertySetter} utility class. 023 * 024 * @author Anders Kristensen 025 * @since 1.1 026 */ 027public class PropertySetterException extends Exception { 028 private static final long serialVersionUID = -1352613734254235861L; 029 protected Throwable rootCause; 030 031 public 032 PropertySetterException(String msg) { 033 super(msg); 034 } 035 036 public 037 PropertySetterException(Throwable rootCause) 038 { 039 super(); 040 this.rootCause = rootCause; 041 } 042 043 /** 044 Returns descriptive text on the cause of this exception. 045 */ 046 public 047 String getMessage() { 048 String msg = super.getMessage(); 049 if (msg == null && rootCause != null) { 050 msg = rootCause.getMessage(); 051 } 052 return msg; 053 } 054}