Skip to content

Sugarcoat error to make it more compatible with gin http response

Notifications You must be signed in to change notification settings

eensymachines-in/apierr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Error using the error interface


We are trying to develop a custom error object graph that will be more aligned to Go Gin framework's http response and also digestable by the log. To keep it compatible with older functions beneath the handlers it also implements (extends) the error interface. This helps in keeping up with the older function interface while using the Throw method in sending out the new error object.

Error correspondence to HTTP status code


This makes the error objects convertible to http responses.

Logging the error and piggybacking on GoGin context


BEfore the errors are dispatched in http.Responses the appropriate HTTP status codes are important. And such that error codes and http responses will have a direct correspondence.

About

Sugarcoat error to make it more compatible with gin http response

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages