Skip to content

AKAMAIEDGEDNS: CODEMAINT: Update error-handling to support wrapped errors #3314

@tlimoncelli

Description

@tlimoncelli

CC @edglynes

Hello friend!

This is low priority, and feel free to respond with "nope, not worth fixing". However I thought I'd let you know:

Describe the bug

errorlint reports:

dnscontrol$ golangci-lint run --sort-results --enable-only errorlint
providers/akamaiedgedns/akamaiEdgeDnsService.go:115:37: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
		if dnsv2.IsConfigDNSError(err) && err.(dnsv2.ConfigDNSError).NotFound() {
		                                  ^
providers/akamaiedgedns/akamaiEdgeDnsService.go:129:37: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
		if dnsv2.IsConfigDNSError(err) && err.(dnsv2.ConfigDNSError).NotFound() {
		                                  ^
providers/akamaiedgedns/akamaiEdgeDnsService.go:244:37: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
		if dnsv2.IsConfigDNSError(err) && err.(dnsv2.ConfigDNSError).NotFound() {

To Reproduce
Steps to reproduce the behavior:

see above

Expected behavior
n/a

DNS Provider

  • AKAMAIEDGEDNS

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions