38 instantiations of ConfigSourceException
aspire (26)
Configuration\ConfigSource.cs (4)
53
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidBinding);
57
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidRepository);
64
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidPath);
69
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidRef);
Configuration\ConfigSourceService.cs (22)
169
throw new
ConfigSourceException
(string.Format(CultureInfo.CurrentCulture,
187
throw new
ConfigSourceException
(string.Format(CultureInfo.CurrentCulture,
208
throw new
ConfigSourceException
(ConfigSourceStrings.ConsentRequired);
298
?? throw new
ConfigSourceException
(ConfigSourceStrings.ConfigLockFailed);
302
throw new
ConfigSourceException
(ConfigSourceStrings.BindingChanged);
380
?? throw new
ConfigSourceException
(ConfigSourceStrings.ConfigLockFailed);
389
throw new
ConfigSourceException
(ConfigSourceStrings.BindingChanged);
436
throw new
ConfigSourceException
(string.Format(CultureInfo.CurrentCulture, ErrorStrings.InvalidJsonInConfigFile, path, ex.Message));
537
?? throw new
ConfigSourceException
(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationFileMustBeJsonObject, path));
559
?? throw new
ConfigSourceException
(ConfigSourceStrings.InvalidBinding);
566
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidBinding);
573
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidBinding);
699
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidCache);
704
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidCache);
752
?? throw new
ConfigSourceException
(ConfigSourceStrings.InvalidConfiguration);
759
throw new
ConfigSourceException
(ConfigSourceStrings.NestedSource);
772
throw new
ConfigSourceException
(ConfigSourceStrings.InvalidConfiguration);
781
throw new
ConfigSourceException
(ConfigSourceStrings.GitTimeout)
806
throw new
ConfigSourceException
(ConfigSourceStrings.GitTimeout)
825
throw new
ConfigSourceException
(ConfigSourceStrings.RepositoryUnavailable);
843
throw new
ConfigSourceException
(ConfigSourceStrings.MissingFile);
850
new
(exception.Failure switch
Aspire.Cli.Tests (12)
Commands\ConfigSourceCommandTests.cs (7)
159
? throw new
ConfigSourceException
(ConfigSourceStrings.GitTimeout) { GitOutput = prompt }
456
git.ReadConfiguration = (_, _) => throw new
ConfigSourceException
(timeout ? ConfigSourceStrings.GitTimeout : ConfigSourceStrings.AuthenticationFailed)
520
git.InspectConfiguration = (_, _) => throw new
ConfigSourceException
(ConfigSourceStrings.AuthenticationFailed);
1422
git.ReadConfiguration = (_, _) => throw new
ConfigSourceException
(ConfigSourceStrings.AuthenticationFailed);
1475
git.ReadConfiguration = (_, _) => throw new
ConfigSourceException
(errorMessage);
1519
git.ReadConfiguration = (_, _) => throw new
ConfigSourceException
(errorMessage);
1554
git.ReadConfiguration = (_, _) => throw new
ConfigSourceException
(ConfigSourceStrings.GitTimeout);
Commands\NewCommandLocalTemplateTests.InitConfig.cs (1)
102
ReadConfiguration = (_, _) => throw new
ConfigSourceException
("Configuration source unavailable.")
Configuration\ConfigSourceServiceTests.cs (4)
425
throw new
ConfigSourceException
("Source unavailable");
1267
ReadConfiguration = (_, _) => throw new
ConfigSourceException
(ConfigSourceStrings.AuthenticationFailed)
1678
git.InspectConfiguration = (_, _) => throw new
ConfigSourceException
(ConfigSourceStrings.AuthenticationFailed);
1851
throw new
ConfigSourceException
("Test acquisition failed");
40 references to ConfigSourceException
aspire (6)
Commands\BaseCommand.cs (1)
195
catch (
ConfigSourceException
ex)
Configuration\ConfigSourceService.cs (5)
501
catch (Exception ex) when (!force && ex is
ConfigSourceException
or JsonException or IOException or UnauthorizedAccessException or TimeoutException)
510
var message = exception is
ConfigSourceException
513
ReportOnce(message, (exception as
ConfigSourceException
)?.GitOutput);
659
catch (
ConfigSourceException
ex)
849
private static
ConfigSourceException
TranslateGitFailure(GitCommandException exception) =>
Aspire.Cli.Tests (34)
Commands\ConfigSourceCommandTests.cs (2)
119
var
exception = await Assert.ThrowsAsync<
ConfigSourceException
>(() =>
Configuration\AspireConfigFileTests.cs (2)
178
var
error = Assert.Throws<
ConfigSourceException
>(result.ConfigSource.Validate);
Configuration\ConfigSourceServiceGitTests.cs (13)
67
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() => client.AcquireAsync(source, workspace.Path, TestContext.Current.CancellationToken));
104
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() => client.AcquireAsync(source, workspace.Path, TestContext.Current.CancellationToken, time));
166
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(RunAsync);
505
await Assert.ThrowsAsync<
ConfigSourceException
>(() => CreateClient(TestHelpers.CreateNonInteractiveHostEnvironment()).AcquireAsync(
515
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() => CreateClient(TestHelpers.CreateNonInteractiveHostEnvironment()).AcquireAsync(
612
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() => client.AcquireAsync(
645
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() =>
Configuration\ConfigSourceServiceTests.cs (17)
177
[InlineData("""{"templateSources":{"enterprise":{"repository":"https://git.example/templates","displayName":42}}}""", typeof(
ConfigSourceException
))]
760
Assert.Throws<
ConfigSourceException
>(() => new ConfigSource { Repository = repository, Path = s_source.Path }.Validate());
769
Assert.Throws<
ConfigSourceException
>(() => new ConfigSource { Repository = repository, Path = s_source.Path }.Validate());
783
Assert.Throws<
ConfigSourceException
>(() => new ConfigSource { Repository = s_source.Repository, Path = path }.Validate());
814
Assert.Throws<
ConfigSourceException
>(() => new ConfigSource { Repository = s_source.Repository, Path = s_source.Path, Ref = reference }.Validate()).Message);
887
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() =>
980
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() =>
1072
Assert.Equal(ConfigSourceStrings.ConsentRequired, (await Assert.ThrowsAsync<
ConfigSourceException
>(() =>
1165
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() =>
1272
var
exception = await Assert.ThrowsAsync<
ConfigSourceException
>(() =>
1860
await Assert.ThrowsAsync<
ConfigSourceException
>(() => service.CheckProjectAsync(workspace.WorkspaceRoot, true, CancellationToken.None));
1927
var
error = await Assert.ThrowsAsync<
ConfigSourceException
>(() =>