SwapDude/SWAD.API/Controllers/ProblemsController.cs
Lisoveliy aebe654c38
Some checks are pending
Deploy / update (push) Waiting to run
Build Project .NET / build (push) Waiting to run
chore: init commit from GitHub
2025-05-12 19:44:33 +03:00

22 lines
684 B
C#

using Microsoft.AspNetCore.Mvc;
namespace SWAD.API.Controllers;
public abstract class ProblemsController : ControllerBase
{
protected ObjectResult BadRequest(string? detail)
{
return Problem(statusCode: StatusCodes.Status400BadRequest, title: "Bad request!", detail: detail);
}
protected ObjectResult NotFound(string? detail)
{
return Problem(statusCode: StatusCodes.Status404NotFound, title: "Not found :c", detail: detail);
}
protected ObjectResult BadGateway(string? detail)
{
return Problem(statusCode: StatusCodes.Status502BadGateway, title: "Some problems in other side, dude!",
detail: detail);
}
}