Skip to content

Error codes ​

A failed request gets {"janus":"error","error":{"code":N,"reason":"..."}}. The codes are the ones of the C server (apierror.h). The reason strings follow the C server's too; the replay scenarios check them for every code they provoke.

CodeNameRaised when
403UnauthorizedWrong or missing apisecret, token or admin_secret.
405Unauthorized pluginThe token does not allow this plugin.
450Transport specificThe transport refused it (for example HTTP with a method it does not take).
452Missing requestA request with no request member where one is needed.
453Unknown requestThe janus value is not known on this path (on the base path the server answers 457).
454Invalid JSONThe body does not parse; the reason carries the parser's message.
455Invalid JSON objectParsed, but not an object.
456Missing mandatory elementA required member is missing, for example transaction or plugin.
457Invalid request pathThe request is not valid at this path.
458Session not foundThe session id is unknown or was destroyed.
459Handle not foundThe handle id is unknown in this session.
460Plugin not foundattach named a plugin that is not loaded.
461Plugin attachThe plugin refused the attach.
462Plugin messageThe plugin could not take the message.
463Plugin detachThe plugin failed to detach.
464JSEP unknown typejsep.type is not offer, answer and so on.
465JSEP invalid SDPThe SDP does not parse or is missing mandatory lines.
466Trickle invalid streamThe candidate names a stream or m-line that does not exist.
467Invalid element typeA member has the wrong JSON type.
468Session conflictA session with this id exists.
469Unexpected answerAn answer arrived without an offer pending.
470Token not foundAdmin token request names an unknown token.
471WebRTC stateThe request does not fit the PeerConnection's state.
472Not accepting sessionscreate while the server is draining (accept_new_sessions set to false).
490Unknown / unsupportedAnything else. In this port also: an Admin request the build does not support, such as query_transport.

Plugin errors are not Janus errors ​

A plugin reports its own errors inside a normal success or event: plugindata.data.error_code and plugindata.data.error. Each plugin has its own error codes, listed on the plugin pages. A client has to check both levels.

json
{
  "janus": "success",
  "plugindata": {
    "plugin": "janus.plugin.videoroom",
    "data": { "videoroom": "event", "error_code": 429, "error": "Missing mandatory element (room)" }
  }
}

That reply is a real one from the binary (see the last exchange of the walkthrough).

GPL-3.0-or-later, like the Janus gateway it ports.