Adds a context to the specified object.
Returns eOk if successful, or an appropriate error code if not.