Errors

From XDIF

Jump to: navigation, search

This is part of OSC Plug And Play.

Agreed standard

OSCit

Currently an error is just encoded with an error code and message. Error codes are copied from http.

Currently used error codes:

  BAD_REQUEST_ERROR     = 400,
  NOT_FOUND_ERROR       = 404,
  INTERNAL_SERVER_ERROR = 500,
  UNKNOWN_ERROR         = 0,

The '400' error is used if the method arguments are bad (bad format or related to missing resources like files).

The '404' is used when the url (method) does not exist.

The '500' error is used when something went wrong. This means that the server itself has a bug and should not happen, whatever the client does.

The '0' error is actually used when system calls fail (read/write fails, opening a port fails, etc). Maybe we should use '502' (bad gateway) ?

AVBC

Errors are sent to "/osc/error" with the following format:

RX: [ "/osc/error" ,iss... (error code) (error description) (original request address) (original request values) ]

Error codes are inspired by HTTP codes. AVBC also uses the error url for success notification with code 2xx.

Personal tools