refatcor: improve error route interceptor

This commit is contained in:
Jonas Kaninda
2024-11-14 09:49:18 +01:00
parent 42abf56473
commit 3c4920ec9a
8 changed files with 25 additions and 54 deletions

View File

@@ -15,17 +15,17 @@
*
*/
package error_interceptor
package errorinterceptor
type ErrorInterceptor struct {
// ContentType error response content type, application/json, plain/text
ContentType string `yaml:"contentType"`
//ContentType string `yaml:"contentType"`
//Errors contains error status code and custom message
Errors []Error `yaml:"errors"`
}
type Error struct {
// Code HTTP status code
Code int `yaml:"code"`
// Message custom message
// Message Error custom response message
Message string `yaml:"message"`
}

View File

@@ -15,7 +15,7 @@
*
*/
package error_interceptor
package errorinterceptor
const TextPlain = "text/plain"
const ApplicationXml = "application/xml"