MCPcopy Create free account
hub / github.com/TryCatchLearn/Restore-v2 / BuggyController

Class BuggyController

API/Controllers/BuggyController.cs:6–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace API.Controllers;
5
6public class BuggyController : BaseApiController
7{
8 [HttpGet("not-found")]
9 public IActionResult GetNotFound()
10 {
11 return NotFound();
12 }
13
14 [HttpGet("bad-request")]
15 public IActionResult GetBadRequest()
16 {
17 return BadRequest("This is not a good request");
18 }
19
20 [HttpGet("unauthorized")]
21 public IActionResult GetUnauthorised()
22 {
23 return Unauthorized();
24 }
25
26 [HttpGet("validation-error")]
27 public IActionResult GetValidationError()
28 {
29 ModelState.AddModelError("Problem1", "This is the first error");
30 ModelState.AddModelError("Problem2", "This is the second error");
31 return ValidationProblem();
32 }
33
34 [HttpGet("server-error")]
35 public IActionResult GetServerError()
36 {
37 throw new Exception("This is a server error");
38 }
39}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected