Skip to content

Conversation

JNjenga
Copy link
Contributor

@JNjenga JNjenga commented Feb 26, 2025

Throwing SQL.BulkLoadNonMatchingColumnMapping exception when column mappings mismatch does not provide enough information about where the error occurred. Throwing SQL.BulkLoadNonMatchingColumnName exception is more appropriate.

Fixes (#3170)

@JNjenga
Copy link
Contributor Author

JNjenga commented Feb 26, 2025

@dotnet-policy-service agree

@paulmedynski paulmedynski requested a review from a team February 27, 2025 17:13

if(!columnMapping._matchedOrRejected)
{
throw (SQL.BulkLoadNonMatchingColumnName(columnMapping.SourceColumn));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does changing from SQL.BulkLoadNonMatchingColumnMapping() to SQL.BulkLoadNonMatchingColumnName() affect our API promises? They both end up throwing InvalidOperationException, so probably not. Callers shouldn't be depending on the message of the exception, but you never know!

Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea overall, with a few improvements noted.

@paulmedynski paulmedynski merged commit 509e7b8 into dotnet:main Mar 5, 2025
1 check passed
@paulmedynski
Copy link
Contributor

@JNjenga - Thanks for the changes!

@mdaigle mdaigle added this to the 7.0-preview1 milestone Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants