Skip to content

Commit 6c023f5

Browse files
Copilotdavidfowl
andcommitted
Improve Blob Container connection string error handling
Co-authored-by: davidfowl <[email protected]>
1 parent 2b4466a commit 6c023f5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Components/Aspire.Azure.Storage.Blobs/AzureBlobStorageContainerSettings.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void IConnectionStringSettings.ParseConnectionString(string? connectionString)
2323
return;
2424
}
2525

26-
// NOTE: if ever these contants are changed, the AzureBlobStorageResource in Aspire.Hosting.Azure.Storage class should be updated as well.
26+
// NOTE: if ever these constants are changed, the AzureBlobStorageResource in Aspire.Hosting.Azure.Storage class should be updated as well.
2727
const string Endpoint = nameof(Endpoint);
2828
const string ContainerName = nameof(ContainerName);
2929

@@ -43,9 +43,10 @@ void IConnectionStringSettings.ParseConnectionString(string? connectionString)
4343
BlobContainerName = containerName?.ToString();
4444
}
4545
}
46-
catch (ArgumentException)
46+
catch (ArgumentException ex)
4747
{
48-
throw;
48+
// Rethrow with more context for easier troubleshooting
49+
throw new ArgumentException($"Invalid connection string format. Ensure it has the format 'Endpoint=value;ContainerName=value'. See inner exception for details.", ex);
4950
}
5051
}
5152
}

0 commit comments

Comments
 (0)