summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-03-12 00:00:36 +0000
committerSadie Powell <sadie@witchery.services>2024-03-12 00:17:49 +0000
commit1538909ac09a0e84269e36a08da5ae9fce92e8f3 (patch)
tree97a986b375f6e1fbfa0df05d017357efdfc4ced1 /include
parenta15f165a1d2d71c3db54d57779bec34914cbc171 (diff)
Add ProtocolException and use it to send fatal errors.
Diffstat (limited to 'include')
-rw-r--r--include/protocol.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/protocol.h b/include/protocol.h
index 612593c89..aeac6a069 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -16,6 +16,17 @@
#include "service.h"
#include "modes.h"
+/** Thrown when a protocol error happens. */
+class CoreExport ProtocolException final
+ : public ModuleException
+{
+public:
+ ProtocolException(const Anope::string &message)
+ : ModuleException(message)
+ {
+ }
+};
+
/* Encapsulates the IRCd protocol we are speaking. */
class CoreExport IRCDProto
: public Service
@@ -109,6 +120,11 @@ public:
virtual Anope::string UID_Retrieve();
virtual Anope::string SID_Retrieve();
+ /** Sends an error to the uplink before disconnecting.
+ * @param reason The error message.
+ */
+ virtual void SendError(const Anope::string &reason);
+
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users
* will be able to oper on the server.
* @param s The server