removed dependencies

This commit is contained in:
julian
2025-01-15 09:02:44 +01:00
parent b457377a80
commit b01a8ca13a
6 changed files with 280 additions and 0 deletions

32
err.go Normal file
View File

@@ -0,0 +1,32 @@
package scn
import (
"errors"
"fmt"
)
type ErrorType string
var (
ErrAuthFailed ErrorType = "GOEXT_SCN_AUTHFAILED"
ErrQuota ErrorType = "GOEXT_SCN_QUOTAEXCEEDED"
ErrBadRequest ErrorType = "GOEXT_SCN_BADREQUEST"
ErrInternalServerErr ErrorType = "GOEXT_SCN_INTERNALSERVER"
ErrOther ErrorType = "GOEXT_SCN_OTHER"
)
type InternalError struct {
errType ErrorType
errorMessage string
}
func NewError(errType ErrorType, errMessage string) *InternalError {
return &InternalError{
errType: errType,
errorMessage: errMessage,
}
}
func (e *InternalError) Build() error {
return errors.New(fmt.Sprintf("[%v]: %v", e.errType, e.errorMessage))
}