apidocs / com.srv4pos.server.api.exceptions.base / JsonDetailedException

JsonDetailedException

abstract class JsonDetailedException : JsonException

Parent for detailed exceptions.

Constructors

<init>

JsonDetailedException()
JsonDetailedException(details: Map<String, String>?)
JsonDetailedException(responseCode: Int, details: Map<String, String>?)

Properties

details

var details: Map<String, String?>?

Sets exception details. For example, contains exception message or violated value.

message

open val message: String

Inherited Properties

exceptionName

val exceptionName: String

responseCode

var responseCode: Int

Functions

deserialize

open fun deserialize(jsonSource: String): JsonDetailedException

Performs deserialization. For serialization see JsonSerializable.serialize.

serialize

open fun serialize(): String

Performs serialization. For deserialization see JsonSerializable.serialize.

toString

open fun toString(): String

Inheritors

ControlUnitReceiptJsonException

class ControlUnitReceiptJsonException : JsonDetailedException, FriendlyException

The details contains three fields:

ForbiddenJsonException

class ForbiddenJsonException : JsonDetailedException

When service returns 403 HTTP status code. For instance if one seller is trying to access data of another seller. Or seller is trying to reach data available for admins only.

HttpHeaderMissingJsonException

class HttpHeaderMissingJsonException : JsonDetailedException

If request param doesn't contain required http header.

InconsistentDataJsonException

class InconsistentDataJsonException : JsonDetailedException

When data sent to the server is in inconsistent state. Exception is packed with unique code as com.srv4pos.server.api.infrastructure.exceptions.enums.InconsistentDataErrorType.

InternalServerErrorJsonException

class InternalServerErrorJsonException : JsonDetailedException

In case of something wrong is going on the server. See .getDetails and .getResponseCode for more info

MessageNotReadableJsonException

class MessageNotReadableJsonException : JsonDetailedException

When sent JSON is failed to parse.

NonUniqueJsonException

class NonUniqueJsonException : JsonDetailedException

When passed data violates some unique constraint.

NotImplementedJsonException

class NotImplementedJsonException : JsonDetailedException, FriendlyException

Thrown by any method. Make sense to catch for com.srv4pos.server.api.auth.AuthService.handshake ()}. Happens usually for local servers: when android device is up to date, but server is not.

ReferenceNotFoundJsonException

class ReferenceNotFoundJsonException : JsonDetailedException

This exception occurs when SomethingInfo dto class contains a field which references to another entity and the algorithm assumes it has to be on the server but it doesn't.

RequestMethodNotSupportedJsonException

class RequestMethodNotSupportedJsonException : JsonDetailedException

RequestParameterMissingJsonException

class RequestParameterMissingJsonException : JsonDetailedException

If request param doesn't contain required http header.

ServiceUnavailableJsonException

class ServiceUnavailableJsonException : JsonDetailedException

Dropped by the server if server is off (for instance server is restarting or in a service mode) or not ready.

TypeMismatchJsonException

class TypeMismatchJsonException : JsonDetailedException

When some entity fails during type conversion. For example, passed java.lang.String as query param is not convertible to java.util.Date. Also occurs when there is a type mismatch during JSON parsing.

UnauthorizedJsonException

class UnauthorizedJsonException : JsonDetailedException

Dropped by server when user tries access resource without any authentications.

UnprocessableEntityJsonException

class UnprocessableEntityJsonException : JsonDetailedException

This exception occurs when every entity field passes validation but there is a logical (semantical) violation.