refuse method
Refuses the client with code and reason, and closes the session.
A refusal is permanent: the client is told why, the server records it, and the session ends. Nothing here can be retried into a success.
Implementation
@protected
Future<void> refuse({
required String documentId,
required String code,
required String reason,
}) async {
await sendMessage(
Message.error(documentId: documentId, code: code, message: reason),
);
addSessionEvent(
SessionEventGeneric(
sessionId: id,
type: SessionEventType.error,
message: 'Client refused for document $documentId: $reason',
),
);
await close();
}