| 4 | namespace API.Controllers; |
| 5 | |
| 6 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected