feat: initial commit

This commit is contained in:
2025-02-21 18:42:56 +01:00
commit ee4a65b345
81 changed files with 3441 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package common
type Error struct {
err string
userMessage string
statusCode int
}
// StatusCode implements HTTPError.
func (e *Error) StatusCode() int {
return e.statusCode
}
// Error implements UserFacingError.
func (e *Error) Error() string {
return e.err
}
// UserMessage implements UserFacingError.
func (e *Error) UserMessage() string {
return e.userMessage
}
func NewError(err string, userMessage string, statusCode int) *Error {
return &Error{err, userMessage, statusCode}
}
var _ UserFacingError = &Error{}
var _ HTTPError = &Error{}