Class ErrorEntity

java.lang.Object
com.atlassian.crowd.plugin.rest.entity.ErrorEntity
All Implemented Interfaces:
Serializable

public final class ErrorEntity extends Object implements Serializable
Represents an error. All errors returned from REST resources should have the error entity in the response.
Since:
v2.1
See Also:
  • Constructor Details

    • ErrorEntity

      public ErrorEntity(ErrorEntity.ErrorReason reason, String message)
      Constructs an error entity.
      Parameters:
      reason - reason for the error.
      message - message
  • Method Details

    • getReason

      public ErrorEntity.ErrorReason getReason()
    • getMessage

      public String getMessage()
    • of

      public static ErrorEntity of(Exception exception)
      Creates appropriate error entity from the given exception.
      Parameters:
      exception - exception from which the ErrorEntity has to be created.
      Returns:
      ErrorEntity.