From 52cc8a418307ae7a551d23e6bd2d367b544e7bf9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 7 Jan 2022 17:12:42 +0000 Subject: Refactor CoreException and ModuleException. --- src/modules/m_websocket.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/m_websocket.cpp') diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp index 0df7e0818..139abd59d 100644 --- a/src/modules/m_websocket.cpp +++ b/src/modules/m_websocket.cpp @@ -594,7 +594,7 @@ class ModuleWebSocket final { auto tags = ServerInstance->Config->ConfTags("wsorigin"); if (tags.empty()) - throw ModuleException("You have loaded the websocket module but not configured any allowed origins!"); + throw ModuleException(this, "You have loaded the websocket module but not configured any allowed origins!"); WebSocketConfig config; for (const auto& [_, tag] : tags) @@ -602,7 +602,7 @@ class ModuleWebSocket final // Ensure that we have the parameter. const std::string allow = tag->getString("allow"); if (allow.empty()) - throw ModuleException(" is a mandatory field, at " + tag->source.str()); + throw ModuleException(this, " is a mandatory field, at " + tag->source.str()); config.allowedorigins.push_back(allow); } @@ -617,7 +617,7 @@ class ModuleWebSocket final else if (stdalgo::string::equalsci(defaultmodestr, "text")) config.defaultmode = WebSocketConfig::DM_TEXT; else - throw ModuleException(defaultmodestr + " is an invalid value for ; acceptable values are 'binary', 'text' and 'reject', at " + tag->source.str()); + throw ModuleException(this, defaultmodestr + " is an invalid value for ; acceptable values are 'binary', 'text' and 'reject', at " + tag->source.str()); irc::spacesepstream proxyranges(tag->getString("proxyranges")); for (std::string proxyrange; proxyranges.GetToken(proxyrange); ) -- cgit v1.3.1-10-gc9f91