-
Notifications
You must be signed in to change notification settings - Fork 850
Don't swallow errors from ExecutionConfigurationBuilder #15475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |||||||||||||||||||||
| using System.Net; | ||||||||||||||||||||||
| using System.Net.Sockets; | ||||||||||||||||||||||
| using System.Runtime.CompilerServices; | ||||||||||||||||||||||
| using System.Runtime.ExceptionServices; | ||||||||||||||||||||||
| using System.Security.Cryptography; | ||||||||||||||||||||||
| using System.Security.Cryptography.X509Certificates; | ||||||||||||||||||||||
| using System.Text; | ||||||||||||||||||||||
|
|
@@ -1870,7 +1871,7 @@ private async Task CreateExecutableAsync(RenderedModelResource er, ILogger resou | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| if (configuration.Exception is not null) | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| throw new FailedToApplyEnvironmentException(); | ||||||||||||||||||||||
| ExceptionDispatchInfo.Throw(configuration.Exception); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
1872
to
1875
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // Invoke the debug configuration callback now that endpoints are allocated. | ||||||||||||||||||||||
|
|
@@ -2344,7 +2345,11 @@ private async Task CreateContainerAsync(RenderedModelResource cr, ILogger resour | |||||||||||||||||||||
| spec.Command = containerResource.Entrypoint; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if (failedToApplyRunArgs || configuration.Exception is not null) | ||||||||||||||||||||||
| if (configuration.Exception is not null) | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| ExceptionDispatchInfo.Throw(configuration.Exception); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| if (failedToApplyRunArgs) | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
|
Comment on lines
+2350
to
2353
|
||||||||||||||||||||||
| ExceptionDispatchInfo.Throw(configuration.Exception); | |
| } | |
| if (failedToApplyRunArgs) | |
| { | |
| resourceLogger.LogError(configuration.Exception, "Failed to configure container startup."); | |
| throw new FailedToApplyEnvironmentException(); | |
| } | |
| if (failedToApplyRunArgs) | |
| { | |
| resourceLogger.LogError("Failed to apply environment configuration for container startup."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use InnerException property to remember the original one (
contiguration.Exception) when constructing theFailedToApplyEnvironmentException?I am also not thrilled by this code using
ExceptionDispatchInfo--seems like a low-level API that is not really necessary here. Maybe we can eliminate it as part of this PR.