Fixed compilation errors introduced in previous commit

This commit is contained in:
Noikoio 2017-07-23 14:44:44 -07:00
parent c0b2501f61
commit 0b70dca915
5 changed files with 16 additions and 13 deletions

View file

@ -75,7 +75,7 @@ namespace Noikoio.RegexBot.ConfigItem
if (section["blacklist"] != null) if (section["blacklist"] != null)
{ {
if (mode == FilterType.Whitelist) if (mode == FilterType.Whitelist)
throw new RuleConfig.RuleImportException("Cannot have whitelist AND blacklist defined."); throw new RuleImportException("Cannot have whitelist AND blacklist defined.");
mode = FilterType.Blacklist; mode = FilterType.Blacklist;
} }
if (mode == FilterType.None) list = new EntityList(); // might even be fine to keep it null? if (mode == FilterType.None) list = new EntityList(); // might even be fine to keep it null?

View file

@ -0,0 +1,12 @@
using System;
namespace Noikoio.RegexBot.ConfigItem
{
/// <summary>
/// Exception thrown during an attempt to read rule configuration.
/// </summary>
public class RuleImportException : Exception
{
public RuleImportException(string message) : base(message) { }
}
}

View file

@ -1,6 +1,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Noikoio.RegexBot.ConfigItem; using Noikoio.RegexBot.ConfigItem;
using Noikoio.RegexBot.Feature.RegexResponder;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -165,7 +166,7 @@ namespace Noikoio.RegexBot
try try
{ {
rule = new RuleConfig(newserver, ruleconf); rule = new RuleConfig(newserver, ruleconf);
} catch (RuleConfig.RuleImportException ex) } catch (RuleImportException ex)
{ {
await SLog("-> Error: " + ex.Message); await SLog("-> Error: " + ex.Message);
return false; return false;

View file

@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace Noikoio.RegexBot.Feature.RegexResponder namespace Noikoio.RegexBot.Feature.RegexResponder
{ {
// Contains code for handling each response in a rule. // Contains code for handling each response in a rule.
partial class RegexResponder partial class EventProcessor
{ {
private delegate Task ResponseProcessor(AsyncLogger l, string cmd, RuleConfig r, SocketMessage m); private delegate Task ResponseProcessor(AsyncLogger l, string cmd, RuleConfig r, SocketMessage m);
private readonly ReadOnlyDictionary<string, ResponseProcessor> _commands; private readonly ReadOnlyDictionary<string, ResponseProcessor> _commands;

View file

@ -147,15 +147,5 @@ namespace Noikoio.RegexBot.Feature.RegexResponder
bool? embedmode = ruleconf["MatchEmbeds"]?.Value<bool>(); bool? embedmode = ruleconf["MatchEmbeds"]?.Value<bool>();
_matchEmbeds = (embedmode.HasValue && embedmode == true); _matchEmbeds = (embedmode.HasValue && embedmode == true);
} }
/// <summary>
/// Exception thrown during an attempt to read rule configuration.
/// </summary>
public class RuleImportException : Exception
{
public RuleImportException(string message) : base(message) { }
}
} }
} }