Skip to content

Commit af09e10

Browse files
authored
Enhance error handling with innerException in DataApiBuilderException (#2621)
## Why make this change? Having the inner exception makes root causing and debugging easier for downstream consumers of data-api-builder. ## What is this change? Added an innerException parameter to the DataApiBuilderException constructor, passing the original exception (ex). This provides better context and aids in debugging by preserving the root cause of the error.
1 parent dcf260a commit af09e10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Core/Services/MetadataProviders/SqlMetadataProvider.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,8 @@ private async Task<DataTable> GetTableWithSchemaFromDataSetAsync(
14681468
throw new DataApiBuilderException(
14691469
message,
14701470
statusCode: HttpStatusCode.ServiceUnavailable,
1471-
subStatusCode: DataApiBuilderException.SubStatusCodes.ErrorInInitialization);
1471+
subStatusCode: DataApiBuilderException.SubStatusCodes.ErrorInInitialization,
1472+
innerException: ex);
14721473
}
14731474
}
14741475

0 commit comments

Comments
 (0)