Errors raised by the client when it cannot connect to a device, or when an active connection is unexpectedly closed.
PROTOCOL
Errors raised by the server on an active connection when a client request is invalid because it doesn't conform to the protocol. This is raised before any user code is executed. User code has no way to know about these errors; much like TCP-level errors never reach user-land software. As a result, the state of the server must be unchanged when such an error is raised.
DATA
Errors related to data validity. When possible, they are raised by the server software, but the user code can also raise them. When such an error is raised, the state of the device must be unchanged.
USER
Errors thrown by user code which don't correspond to data errors. User errors don't have fixed error messages.
SECURITY
Errors raised following authentication and/or authorisation errors. Security can be managed at different levels (it can be before the client attempts a connection, or on the server, or anywhere in between).