Minor doc/exception edits
This commit is contained in:
@@ -12,10 +12,7 @@
|
|||||||
/// <summary> Gets or sets the minimum log level severity that will be sent to the Log event. </summary>
|
/// <summary> Gets or sets the minimum log level severity that will be sent to the Log event. </summary>
|
||||||
public LogSeverity LogLevel { get; set; } = LogSeverity.Info;
|
public LogSeverity LogLevel { get; set; } = LogSeverity.Info;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary> Gets or sets whether RunMode.Sync commands should push exceptions up to the caller. </summary>
|
||||||
/// Gets or sets whether RunMode.Sync commands should push exceptions up to the caller.
|
|
||||||
/// If false or an RunMode.Async command, exceptions are only reported in the Log event.
|
|
||||||
///</summary>
|
|
||||||
public bool ThrowOnError { get; set; } = true;
|
public bool ThrowOnError { get; set; } = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,9 +50,7 @@ namespace Discord.Commands
|
|||||||
public bool TryAddFactory<T>(Func<T> factory) where T : class
|
public bool TryAddFactory<T>(Func<T> factory) where T : class
|
||||||
{
|
{
|
||||||
var type = typeof(T);
|
var type = typeof(T);
|
||||||
if (_typeBlacklist.Contains(type))
|
if (_typeBlacklist.Contains(type) || map.ContainsKey(type))
|
||||||
throw new InvalidOperationException($"{type.FullName} is used internally and cannot be added as a dependency");
|
|
||||||
if (map.ContainsKey(type))
|
|
||||||
return false;
|
return false;
|
||||||
map.Add(type, factory);
|
map.Add(type, factory);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user