Skip to content

Commit 43603af

Browse files
committed
Improve error message
Signed-off-by: Tamal Saha <[email protected]>
1 parent ad1d110 commit 43603af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/server/utils.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package server
1818

1919
import (
20-
"errors"
2120
"fmt"
2221
"net"
2322
"net/http"
@@ -33,10 +32,10 @@ import (
3332
func DomainWithMXRecord(domain string) error {
3433
records, err := net.LookupMX(domain)
3534
if err != nil {
36-
return err
35+
return fmt.Errorf("no MX records for domain %s: %w", domain, err)
3736
}
3837
if len(records) == 0 {
39-
return errors.New("no MX records")
38+
return fmt.Errorf("no MX records for domain %s", domain)
4039
}
4140
return nil
4241
}

0 commit comments

Comments
 (0)