001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.log;
016    
017    /**
018     * @author Tomas Polesovsky
019     */
020    public class LogSanitizerException extends Exception {
021    
022            public LogSanitizerException() {
023            }
024    
025            public LogSanitizerException(String message) {
026                    super(message);
027            }
028    
029            public LogSanitizerException(
030                    String message, StackTraceElement[] stackTraceElements,
031                    Throwable throwable) {
032    
033                    super(message, throwable);
034    
035                    setStackTrace(stackTraceElements);
036            }
037    
038            public LogSanitizerException(String message, Throwable throwable) {
039                    super(message, throwable);
040            }
041    
042            public LogSanitizerException(Throwable throwable) {
043                    super(throwable);
044            }
045    
046            @Override
047            public String toString() {
048                    Class<?> clazz = getClass();
049    
050                    String className = clazz.getName();
051    
052                    String localizedMessage = getLocalizedMessage();
053    
054                    if (localizedMessage != null) {
055                            return localizedMessage;
056                    }
057    
058                    return className;
059            }
060    
061    }