Class RpcApplicationException

All Implemented Interfaces:
Serializable

public final class RpcApplicationException extends RpcException
Исключение, которое server-side application code может выбросить, чтобы вернуть caller-у structured remote error.

Exception thrown by server-side application code to return a structured remote error to the caller.

Для общих system-like значений используй RpcStatus. Для бизнес-ошибок сервиса можно использовать custom code >= 1000.

Use RpcStatus for shared system-like semantics, or provide a custom application code >= 1000 when the service contract defines its own business error space.

See Also:
  • Constructor Details

    • RpcApplicationException

      public RpcApplicationException(RpcStatus status, String message)
      Создаёт application exception с predefined status.

      Creates an application exception with a predefined status.

      Parameters:
      status - transport/application status
      message - human-readable error message
    • RpcApplicationException

      public RpcApplicationException(RpcStatus status, String message, Throwable cause)
      Создаёт application exception с predefined status и cause.

      Creates an application exception with a predefined status and cause.

      Parameters:
      status - transport/application status
      message - human-readable error message
      cause - original cause
    • RpcApplicationException

      public RpcApplicationException(int statusCode, String message)
      Создаёт application exception с custom application code.

      Creates an application exception with a custom application-defined code.

      Parameters:
      statusCode - custom status code, must be >= 1000
      message - human-readable error message
    • RpcApplicationException

      public RpcApplicationException(int statusCode, String message, Throwable cause)
      Создаёт application exception с custom application code и cause.

      Creates an application exception with a custom application-defined code and cause.

      Parameters:
      statusCode - custom status code, must be >= 1000
      message - human-readable error message
      cause - original cause
  • Method Details

    • statusCode

      public int statusCode()
      Возвращает числовой status code, который должен уйти remote-side.

      Returns the numeric status code that should be propagated remotely.

      Returns:
      numeric remote status code