diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index d1829a8c..8c3f8865 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -200,7 +200,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: true - if: ${{ !contains(github.event.head_commit.message, 'skip')}} + if: ${{ !contains(github.event.head_commit.message, 'skip') || !contains(github.event.head_commit.message, 'skipci')}} steps: - name: dummy action run: "echo 'dummy action that checks if the build is to be skipped, if it is, this action does not run to break the entire build action'" diff --git a/MinecraftClient/CommandHandler/CmdResult.cs b/MinecraftClient/CommandHandler/CmdResult.cs index 4be40a4a..8ecafc8a 100644 --- a/MinecraftClient/CommandHandler/CmdResult.cs +++ b/MinecraftClient/CommandHandler/CmdResult.cs @@ -22,7 +22,7 @@ namespace MinecraftClient.CommandHandler public CmdResult() { this.status = Status.NotRun; - this.result = null; + this.result = "Command did not run, cannot determine the result of the command."; } public Status status; @@ -35,7 +35,7 @@ namespace MinecraftClient.CommandHandler this.result = status switch { #pragma warning disable format // @formatter:off - Status.NotRun => null, + Status.NotRun => "Command did not run, cannot determine the result of the command.", Status.FailChunkNotLoad => null, Status.FailNeedEntity => Translations.extra_entity_required, Status.FailNeedInventory => Translations.extra_inventory_required, diff --git a/MinecraftClient/Scripting/CSharpRunner.cs b/MinecraftClient/Scripting/CSharpRunner.cs index 1792dd5c..7f6c6e77 100644 --- a/MinecraftClient/Scripting/CSharpRunner.cs +++ b/MinecraftClient/Scripting/CSharpRunner.cs @@ -116,10 +116,15 @@ namespace MinecraftClient.Scripting foreach (var failure in result.Failures) { - ConsoleIO.WriteLogLine($"[Script] Error in {scriptName}, line:col{failure.Location.GetMappedLineSpan()}: [{failure.Id}] {failure.GetMessage()}"); + // Get the line that contains the error: + + var loc = failure.Location.GetMappedLineSpan(); + var line = code.Split('\n')[loc.StartLinePosition.Line]; + + ConsoleIO.WriteLogLine($"[Script] Error in {scriptName}, on line ({line.Trim()}): [{failure.Id}] {failure.GetMessage()}"); } - throw new CSharpException(CSErrorType.InvalidScript, new InvalidProgramException("Compilation failed due to error.")); + throw new CSharpException(CSErrorType.InvalidScript, new InvalidProgramException("Compilation failed due to error(s).")); } ConsoleIO.WriteLogLine("[Script] Compilation done with no errors."); @@ -182,8 +187,7 @@ namespace MinecraftClient.Scripting public CSErrorType ExceptionType { get { return _type; } } public override string Message { get { return InnerException!.Message; } } public override string ToString() { return InnerException!.ToString(); } - public CSharpException(CSErrorType type, Exception inner) - : base(inner != null ? inner.Message : "", inner) + public CSharpException(CSErrorType type, Exception inner) : base(inner.Message, inner) { _type = type; }