Notice
Base class for a user-facing refusal or a reported fault.
Throw a Notice to stop a handler and reply to the user. The framework catches it at the controller boundary and renders render, which always decides what the user sees. With report false that render is all that happens. With report true the framework also logs the fault and publishes it to the handledException bus. A raw, non-Notice throw shows the generic message.
abstract class Notice extends ErrorMember visibility
Filter class members by access level.
protected Notice(message: string, options?: ErrorOptions)public ephemeral: booleanDefault:true
Whether this denial is a reported fault. True also logs it and publishes it to the handledException bus. The user always sees render either way.
public report: booleanDefault:false
- optional
A short one-line reason. When every arm of an or gate refuses and each one sets this, or throws a refusal listing them under You need to meet at least one of these:. Write a verb phrase that finishes that line, for example, "be the bot owner".
public summary: stringpublic abstract render(ctx: RenderContext): ReplyResponse