Skip to content

feat: improve ResendRetrieveError to match all API error shapes #5

@asielcabrera

Description

@asielcabrera

Description

The ResendRetrieveError model may not cover all error response shapes returned by the Resend API.

Current model

public struct ResendRetrieveError: Codable, Sendable, Error {
    public var statusCode: Int
    public var message: String
    public var name: String
}

Verified API responses

// Validation error
{"statusCode":400,"message":"Your plan includes 3 segments.","name":"validation_error"}

// Domain error
{"statusCode":403,"message":"domain has been registered already","name":"validation_error"}

// Not found
{"statusCode":422,"message":"Email is not scheduled","name":"validation_error"}

// Application error (500)
{"message":"Something went wrong","statusCode":500,"name":"application_error"}

The model currently works for all observed cases, but we should add tests for edge cases and possibly add an errors array field for batch errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    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