Skip to content

error handling on update_a_block masks errors as empty responses #22

@foo-1a

Description

@foo-1a

the implementation on update_a_block is currently masking API rejections errors as empty responses.
As an example, sending a single RichText element containing a text of more than 2000 chars will result in a 400 rejection with error from the API. The client however, returns an Ok(..) with a defaulted UpdateABlockRequest .

If I understand it correctly, deserializing the resulting json body into a notion_client::objects::Response is meant to detect an error by deserialising an error response into a Response::Error variant - however, since the enum is marked as #[serde(untagged)] and untagged processing going in order of enum variants, it appears that a Response::Success(UpdateABlockRequest) is able to be deserialised from an error response - resulting in the error being masked as an empty result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions