mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Regex instead of StartsWith for better accuracy
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -23,7 +24,7 @@ namespace Tgstation.Server.Tests.Live
|
||||
{
|
||||
var logMessage = formatter(state, exception);
|
||||
if ((logLevel == LogLevel.Error
|
||||
&& !logMessage.StartsWith("Error disconnecting connection ")
|
||||
&& !Regex.IsMatch(logMessage, "Error disconnecting connection [1-9][0-9]*!")
|
||||
&& !(logMessage.StartsWith("An exception occurred while iterating over the results of a query for context type") && exception is TaskCanceledException))
|
||||
|| (logLevel == LogLevel.Critical && logMessage != "DropDatabase configuration option set! Dropping any existing database..."))
|
||||
failureSink(new AssertFailedException("TGS logged an error!"));
|
||||
|
||||
Reference in New Issue
Block a user