TechnicalException.java

  1. package no.nav.data.common.exceptions;

  2. import lombok.Getter;
  3. import org.springframework.http.HttpStatus;
  4. import org.springframework.web.bind.annotation.ResponseStatus;

  5. @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
  6. @Getter
  7. public class TechnicalException extends RuntimeException {

  8.     private final HttpStatus httpStatus;

  9.     public TechnicalException(String message) {
  10.         super(message);
  11.         this.httpStatus = HttpStatus.OK;
  12.     }

  13.     public TechnicalException(String message, Throwable cause) {
  14.         super(message, cause);
  15.         this.httpStatus = HttpStatus.OK;
  16.     }

  17.     public TechnicalException(String message, Throwable cause, HttpStatus httpStatus) {
  18.         super(message, cause);
  19.         this.httpStatus = httpStatus;
  20.     }
  21. }