/*
 * Copyright 2013 Netflix, Inc.
 *
 *      Licensed under the Apache License, Version 2.0 (the "License");
 *      you may not use this file except in compliance with the License.
 *      You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *      Unless required by applicable law or agreed to in writing, software
 *      distributed under the License is distributed on an "AS IS" BASIS,
 *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *      See the License for the specific language governing permissions and
 *      limitations under the License.
 */
package com.netflix.zuul.exception;

/**
 * All handled exceptions in Zuul are ZuulExceptions
 * @author Mikey Cohen
 * Date: 10/20/11
 * Time: 4:33 PM
 */
public class ZuulException extends RuntimeException
{
    private String errorCause;
    private int statusCode = 500;
    private boolean shouldLogAsError = true;

    /**
     * Source Throwable, message, status code and info about the cause
     * @param sMessage
     * @param throwable
     * @param errorCause
     */
    public ZuulException(String sMessage, Throwable throwable, String errorCause) {
        super(sMessage, throwable);
        this.errorCause = errorCause;
    }

    /**
     * error message, status code and info about the cause
     * @param sMessage
     * @param errorCause
     */
    public ZuulException(String sMessage, String errorCause) {
        super(sMessage);
        this.errorCause = errorCause;
    }

    public ZuulException(Throwable throwable, String sMessage) {
        super(sMessage, throwable);
        this.errorCause = "GENERAL";
    }

    public ZuulException(Throwable throwable) {
        super(throwable);
        this.errorCause = "GENERAL";
    }

    public ZuulException(String sMessage) {
        super(sMessage);
        this.errorCause = "GENERAL";
    }

    public int getStatusCode()
    {
        return statusCode;
    }
    public void setStatusCode(int statusCode)
    {
        this.statusCode = statusCode;
    }

    public void dontLogAsError() {
        shouldLogAsError = false;
    }

    public boolean shouldLogAsError() {
        return shouldLogAsError;
    }

    public String getErrorCause() {
        return errorCause;
    }
}

@@ -1470,37 +1470,208 @@
 ) %7B%0A        
-super(sMessag
+this(sMessage, errorCause, false);%0A    %7D%0A%0A    public ZuulException(String sMessage, String errorCause, boolean noStackTrace) %7B%0A        super(sMessage, null, noStackTrace, ! noStackTrac
 e);%0A        
@@ -2022,29 +2022,169 @@
         
-super(sMessag
+this(sMessage, false);%0A    %7D%0A%0A    public ZuulException(String sMessage, boolean noStackTrace) %7B%0A        super(sMessage, null, noStackTrace, ! noStackTrac
 e);%0A    

Add some ZuulException constructors that allow avoiding generation of stacktraces