🐛 Fix error handling and logging

This commit is contained in:
2024-03-13 17:26:30 +04:00
parent 6265458bc3
commit 5af2714abb
8 changed files with 92 additions and 25 deletions

9
app/errors/api.go Normal file
View File

@ -0,0 +1,9 @@
package errors
import "errors"
var (
ErrAPITemplateParsing = errors.New("an error occured while parsing template please try again later")
ErrAPIInvalidURL = errors.New("invalid URL")
ErrAPI503 = errors.New("service unavailable please try again later")
)

9
app/errors/db.go Normal file
View File

@ -0,0 +1,9 @@
package errors
import "errors"
var (
ErrDBCreateURL = errors.New("an error occured please try again later")
ErrDBGetURL = errors.New("an error occured please try again later")
ErrDBURLNotFound = errors.New("url not found")
)