All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openmetadata.service.exception.IncidentManagerException Maven / Gradle / Ivy

There is a newer version: 1.5.11
Show newest version
package org.openmetadata.service.exception;

import javax.ws.rs.core.Response;
import org.openmetadata.schema.tests.type.TestCaseResolutionStatusTypes;
import org.openmetadata.sdk.exception.WebServiceException;

public class IncidentManagerException extends WebServiceException {
  private static final String ERROR_TYPE = "INCIDENT_INVALID_STATUS";

  protected IncidentManagerException(Response.Status status, String message) {
    super(status.getStatusCode(), ERROR_TYPE, message);
  }

  public IncidentManagerException(String message) {
    super(Response.Status.INTERNAL_SERVER_ERROR, ERROR_TYPE, message);
  }

  public static IncidentManagerException invalidStatus(
      TestCaseResolutionStatusTypes lastStatus, TestCaseResolutionStatusTypes newStatus) {
    return new IncidentManagerException(
        Response.Status.BAD_REQUEST,
        String.format("Incident with status [%s] cannot be moved to [%s]", lastStatus, newStatus));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy