/* * This file is part of the Cerebro distribution. * (https://github.com/voyages-sncf-technologies/cerebro) * Copyright (C) 2017 VSCT. * * Cerebro is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, version 3 of the License. * * Cerebro is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.vsct.supervision.notification.exception; import com.fasterxml.jackson.annotation.JsonFilter; import com.vsct.supervision.notification.ErrorCode; @JsonFilter("responseFilter") public class CerebroException extends RuntimeException { private static final long serialVersionUID = 1L; private ErrorCode errorCode; private String errorMessage; public CerebroException(){ } public CerebroException(ErrorCode errorCode, String errorMessage) { super(errorMessage); this.errorMessage = errorMessage; this.errorCode = errorCode; } public CerebroException(ErrorCode errorCode, String errorMessage, Throwable cause) { super(errorMessage, cause); this.errorMessage = errorMessage; this.errorCode = errorCode; } public void setErrorCode(ErrorCode errorCode) { this.errorCode = errorCode; } public ErrorCode getErrorCode() { return errorCode; } public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } public String getErrorMessage() { return errorMessage; } }