Skip to content

Commit

Permalink
Change exception type
Browse files Browse the repository at this point in the history
  • Loading branch information
v-umangsr authored and v-umangsr committed Oct 21, 2024
1 parent 120ce0e commit 56744ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Azure.Functions.Cli/Helpers/GlobalCoreToolsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static WorkerRuntime CurrentWorkerRuntime
if (_currentWorkerRuntime == WorkerRuntime.None)
{
ColoredConsole.Error.WriteLine(QuietWarningColor("Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --java, --python, --powershell, --custom]"));
throw new InvalidOperationException($"Worker runtime cannot be '{WorkerRuntime.None}'. Please set a valid runtime.");
throw new CliException($"Worker runtime cannot be '{WorkerRuntime.None}'. Please set a valid runtime.");
}
return _currentWorkerRuntime;
}
Expand Down
2 changes: 1 addition & 1 deletion test/Azure.Functions.Cli.Tests/PublishActionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void ValidateFunctionAppPublish_ThrowException_WhenWorkerRuntimeIsNone()
{
GlobalCoreToolsSettings.SetWorkerRuntime(WorkerRuntime.None);

var ex = Assert.Throws<InvalidOperationException>(() => GlobalCoreToolsSettings.CurrentWorkerRuntime);
var ex = Assert.Throws<CliException>(() => GlobalCoreToolsSettings.CurrentWorkerRuntime);
Assert.Equal($"Worker runtime cannot be '{WorkerRuntime.None}'. Please set a valid runtime.", ex.Message);
}

Expand Down

0 comments on commit 56744ec

Please sign in to comment.