MCPcopy
hub / github.com/knadh/listmonk / pqErrMsg

Function pqErrMsg

internal/core/core.go:126–133  ·  view source on GitHub ↗

Given an error, pqErrMsg will try to return pq error details if it's a pq error.

(err error)

Source from the content-addressed store, hash-verified

124// Given an error, pqErrMsg will try to return pq error details
125// if it's a pq error.
126func pqErrMsg(err error) string {
127 if err, ok := err.(*pq.Error); ok {
128 if err.Detail != "" {
129 return fmt.Sprintf("%s. %s", err, err.Detail)
130 }
131 }
132 return err.Error()
133}
134
135// makeSearchQuery cleans an optional search string and prepares the
136// query SQL statement (string interpolated) and returns the

Callers 15

QueryCampaignsMethod · 0.85
getCampaignMethod · 0.85
GetCampaignForPreviewMethod · 0.85
GetArchivedCampaignsMethod · 0.85
CreateCampaignMethod · 0.85
UpdateCampaignMethod · 0.85
UpdateCampaignStatusMethod · 0.85
UpdateCampaignArchiveMethod · 0.85
DeleteCampaignMethod · 0.85
DeleteCampaignsMethod · 0.85
CampaignHasListsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected