Skip to content

Wrap serde failures in a SerdeException instead of leaking Jackson types across the SPI #22

Description

@OmarAlJarrah

Problem

The serde package declares no exception type (serde/{Serde,Serializer,Deserializer}.kt), so the Jackson adapter throws raw com.fasterxml.jackson.* exceptions across the zero-dep SPI boundary. Callers coding against the SPI can't catch a stable type, and the abstraction leaks its implementation.

Proposed change

Add open class SerdeException(message, cause) : RuntimeException in serde/ (optionally SerializationException/DeserializationException). Catch JsonProcessingException/MismatchedInputException in the Jackson adapter and rethrow as SerdeException. Do not extend the HTTP exception family.

Acceptance

  • Adapter never propagates com.fasterxml.* across the SPI
  • Test: malformed payload surfaces SerdeException
  • apiDump

Priority: high · Effort: small

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsdk-coresdk-core toolkit

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions