Skip to content

headers function gives incorrect error message when code not provided #349

@Schommer79

Description

@Schommer79

Observed behavior

The headers function tests for a non-default code or description paired with a default code or description.

In either case it throws an InvalidArgumentError saying "'description' is required". This is incorrect and misleading when it is the code that is missing.

Expected behavior

It should provide a different error messages depending on what is missing or simply state that 'both code and description are required' as it did before.

Server and client version

nats-core version 3.2.0

Host environment

node

Steps to reproduce

call the header function with undefined code and description text

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