Skip to content

What should dec_hook raise if the type is unsupported? #774

Description

@lunik1

Question

There seems to be a (deliberate?) inconsistency in the docs regarding what exception dec_hook should raise if the expected message type is unsupported.

json.decode states that TypeError should be raised.
All other instances state that NotImplementedError should be raised.

Can you clarify which is correct?

  • dec_hook should raise TypeError for unsupported types
  • dec_hook should raise NotImplementedError for unsupported types
  • dec_hook should raise NotImplementedError for unsupported types, unless it is being passed to msgspec.json.decode when it should raise TypeError.
  • other?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions