Azure / Azure/azure-functions-sql-extension
Errors on startup can be unclear
- Dominant language
- C#
- Stars
- 130
- Forks
- 71
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 4
Description
If there's an error on startup - for example in https://github.com/Azure/azure-functions-sql-extension/blob/main/src/SqlConverters.cs#L171 - then the raw error is displayed to the user, which may not be useful in figuring out exactly what went wrong. e.g. it might just look something like this
` [2022-09-07T05:58:49.911Z] System.Private.CoreLib: Exception while executing function: GetProducts. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'products'. Microsoft.Data.SqlClient: Invalid operation. The connection is closed.`
Instead, it may be better to wrap that exception in another one that gives more info about what it was doing when it failed. For the above it would look something like this :
`Exception binding parameter 'products'. Error converting to IAsyncEnumerable. Microsoft.Data.SqlClient: Invalid operation. The connection is closed.`
Although we should first look into whether stack trace info is available for errors - since if that is available then we may not need to do the extra work here. (but we should look into enabling that for our tests since right now those just seem to give the error message itself)
Contributor guide
Assessment
This issue has not been assessed yet.