Open ivucica opened 3 years ago
Neither RFC3920 nor RFC6120 require the code attribute on <error/>, but the implementation of stanza.Err type makes it required, and silently so:
code
<error/>
stanza.Err
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.
Neither RFC3920 nor RFC6120 require the
code
attribute on<error/>
, but the implementation ofstanza.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.