-1

I want to add custom response codes to my HTTP response.

Like; 10001 -> prices should be lower than 999 Right now, I can only use internal response codes. Is there a way to use our custom HTTP response codes for our custom error texts?

if _, err := uuid.Parse(id); err != nil {
c.Response().Status = 4004
}
dante0x75
  • 1
  • 3
  • what you should really do is returning standard HTTP status codes like 400 or 500, and some other payload with details about the error, possibly including some application-defined error codes – blackgreen May 31 '22 at 08:59

0 Answers0