webhook.go 563 B

12345678910111213141516171819202122232425262728293031
  1. package errors
  2. import "fmt"
  3. type WebhookNotExist struct {
  4. ID int64
  5. }
  6. func IsWebhookNotExist(err error) bool {
  7. _, ok := err.(WebhookNotExist)
  8. return ok
  9. }
  10. func (err WebhookNotExist) Error() string {
  11. return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
  12. }
  13. type HookTaskNotExist struct {
  14. HookID int64
  15. UUID string
  16. }
  17. func IsHookTaskNotExist(err error) bool {
  18. _, ok := err.(HookTaskNotExist)
  19. return ok
  20. }
  21. func (err HookTaskNotExist) Error() string {
  22. return fmt.Sprintf("hook task does not exist [hook_id: %d, uuid: %s]", err.HookID, err.UUID)
  23. }