Skip to content

stanza.Err makes 'code' non-optional #170

@ivucica

Description

@ivucica

Neither RFC3920 nor RFC6120 require the code attribute on <error/>, but the implementation of stanza.Err type makes it required, and silently so:

https://github.com/FluuxIO/go-xmpp/blob/947fcf0/stanza/error.go#L81-L83

That is: omitting code requires in the whole element silently not being marshalled.

The check for code==0 should merely result in the code attribute being omitted, not in the whole <error/> being omitted.

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