如何调试RocketChat错误-不允许(尝试邀请和添加/删除所有者)

Pid*_*ida 5 ruby-on-rails rocket.chat

我们通过 Docker 镜像rocketchat/rocket.chat:0.68.4和 Ruby rocketchatgem 使用 RocketChat。

已经有一些可以更新通道属性的工作功能:

# RocketChatService is a wrapper class for a RocketChat::Session object with authentication as admin
channels = RocketChatService.channels

channels.set_attr(name: id, topic: escape_nil(title)) if title_changed?
channels.set_attr(name: id, description: escape_nil(description)) if description_changed?
channels.set_attr(name: id, custom_fields: { project_id: project_id }) if project_id && project_id_was.nil?
Run Code Online (Sandbox Code Playgroud)

但现在我们还需要向房间添加新用户,使他们成为所有者,或降级以前的所有者。以下代码在某些情况下有效(恐怕这里介绍起来太复杂),但有时会导致错误:

# idempotent
channels.invite(name: id, username: creator_id)

# TODO: already an owner
channels.add_owner(name: id, username: creator_id)

channels.remove_owner(name: id, username: creator_id_was)
Run Code Online (Sandbox Code Playgroud)

问题是这些错误消息的信息量不大:

"exception"=>"Not allowed [error-not-allowed]"
Run Code Online (Sandbox Code Playgroud)

RocketChat 中没有日志文件,stdout发生这种情况时也不会写入任何内容。这让我想到了我的问题:如何调试像上面这样的错误消息?