You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Debugging: Add tasks and launch
#!components: grid-bot,grid-bot-recovery
#!deployable-components: grid-bot
~ Add build tasks for debug and full debug builds.
~ Add launch scripts for local debugging.
* Projects: Bump Discord.Net
Bumps Discord.Net to 3.15.3
* Update to OnLogMessage
Support logging GatewayReconnectException, WebSocketException, WebSocketClosedException, and TaskCanceledException in debug builds
* Feature: Script logging
Implement logging of scripts to a Discord channel, helps with future debugging of issues that arrise.
Has duplication detection via hash checking of script contents.
* LuaVM
Suit changes made to parsing system
* ExecuteScript: Syntax error and script logging
~ Log scripts just before preprocessing.
~ Add detection of grid-server level syntax errors.
~ Add detection of invalid json return data.
~ Add detection of invalid ASCII return data.
* Update Runner.cs
~ Add script logger to dependency injection container.
* Update build.yml
Signed-off-by: Nikita Petko <petko@vmminfra.net>
* Update deploy.yml
Signed-off-by: Nikita Petko <petko@vmminfra.net>
* ScriptLogger: Persistence
~ Do not persist script hashes immediately, as this could cause a major influx of Vault writes.
* Update deploy.yml
Signed-off-by: Nikita Petko <petko@vmminfra.net>
* Update .component.yaml
Signed-off-by: Nikita Petko <petko@vmminfra.net>
* Fix for hashes
---------
Signed-off-by: Nikita Petko <petko@vmminfra.net>
// Needs to be reported, get the original script, the fully constructed script and all information about channels, users, etc.
368
-
awaitFollowupAsync("There was an internal error, please try again later.");
379
+
varmessage=ex.Message;
380
+
if(GridSyntaxErrorRegex().IsMatch(message))
381
+
{
382
+
varmatch=GridSyntaxErrorRegex().Match(message);
383
+
varline=match.Groups[1].Value;
384
+
varerror=match.Groups[2].Value;
385
+
386
+
// We need to subtract the lines that the template adds (otherwise for one liners it will appear to be on line like 500 and something)
387
+
if(_scriptsSettings.LuaVMEnabled)
388
+
{
389
+
conststring_marker="{0}";
390
+
391
+
vartemplate=_luaUtility.LuaVMTemplate;
392
+
vartemplateLines=template.Split('\n');
393
+
394
+
varlineIndex=Array.FindIndex(templateLines, line =>line.StartsWith(_marker));
395
+
396
+
if(lineIndex!=-1)
397
+
line=(int.Parse(line)-lineIndex).ToString();
398
+
}
399
+
400
+
awaitLuaErrorAsync($"Line {line}: {error}");
401
+
402
+
return;
403
+
}
404
+
405
+
if(message.Contains(_ErrorConvertingToJson))
406
+
{
407
+
awaitLuaErrorAsync("The script returned a value that could not be converted to JSON.");
408
+
409
+
return;
410
+
}
411
+
}
412
+
413
+
// If ex.InnerException.InnerException is a XmlException, it's likely that the script returned invalid ASCII characters.
414
+
// Catch this and alert the user (only in the case of ex is CommunicationException, ex.InnerException is InvalidOperationException and ex.InnerException.InnerException is XmlException)
0 commit comments