Handle MasterTemplateNotFound as bad request instead of unepxected (#16445)

This commit is contained in:
Bjarke Berg
2024-05-31 12:39:48 +02:00
committed by GitHub
parent e6568c69dc
commit 7c1f541bbb

View File

@@ -34,6 +34,10 @@ public class TemplateControllerBase : ManagementApiControllerBase
.WithTitle("Invalid master template")
.WithDetail("The master template referenced in the template leads to a circular reference.")
.Build()),
TemplateOperationStatus.MasterTemplateNotFound => BadRequest(problemDetailsBuilder
.WithTitle("Master template not found")
.WithDetail("The master template referenced in the template was not found.")
.Build()),
_ => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
.WithTitle("Unknown template operation status.")
.Build()),