summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorC. McEnroe2020-02-05 23:27:43 -0500
committerC. McEnroe2020-02-05 23:27:43 -0500
commit3085779d86f3ed66bd24eccf1f64ffc1bd71afcd (patch)
tree29cc9bcf3e11fb22ed1f4f8bbd5621ea526feb23 /handle.c
parent839cc362a85e3cf463cd0cfe6c092ca0978b8c29 (diff)
Handle ERROR
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/handle.c b/handle.c
index 85783d7..89ebcb2 100644
--- a/handle.c
+++ b/handle.c
@@ -233,6 +233,11 @@ static void handlePing(struct Message *msg) {
 	ircFormat("PONG :%s\r\n", msg->params[0]);
 }
 
+static void handleError(struct Message *msg) {
+	require(msg, false, 1);
+	errx(EX_UNAVAILABLE, "%s", msg->params[0]);
+}
+
 static const struct Handler {
 	const char *cmd;
 	Handler *fn;
@@ -248,6 +253,7 @@ static const struct Handler {
 	{ "906", handleErrorSASLFail },
 	{ "AUTHENTICATE", handleAuthenticate },
 	{ "CAP", handleCap },
+	{ "ERROR", handleError },
 	{ "JOIN", handleJoin },
 	{ "NOTICE", handlePrivmsg },
 	{ "PING", handlePing },