Updated all 404 and 500 responses to use problem details model (#14634)
* Updated all 404 and 500 responses to use problem details * Updated OpenApi.json * Add missing ProducesResponseType * Updated OpenApi.json
This commit is contained in:
@@ -24,10 +24,16 @@ public abstract class TemporaryFileControllerBase : ManagementApiControllerBase
|
||||
.WithDetail("The specified key is already used.")
|
||||
.Build()),
|
||||
|
||||
TemporaryFileOperationStatus.NotFound => NotFound(),
|
||||
_ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown temporary file operation status")
|
||||
TemporaryFileOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder()
|
||||
.WithTitle("The temporary file was not found")
|
||||
.Build()),
|
||||
_ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder()
|
||||
.WithTitle("Unknown temporary file operation status.")
|
||||
.Build()),
|
||||
};
|
||||
|
||||
|
||||
protected new IActionResult NotFound() => NotFound("The temporary file could not be found");
|
||||
protected IActionResult TemporaryFileNotFound() => NotFound(new ProblemDetailsBuilder()
|
||||
.WithTitle("The temporary file could not be found")
|
||||
.Build());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user