diff --git a/artifactory/replication.go b/artifactory/replication.go index 4a4b0e5..df48774 100644 --- a/artifactory/replication.go +++ b/artifactory/replication.go @@ -2,6 +2,7 @@ package artifactory import ( "encoding/json" + "errors" "fmt" ) @@ -39,7 +40,8 @@ func (c *Client) FetchReplications() (Replications, error) { c.logger.Debug("Fetching replications stats") resp, err := c.FetchHTTP(replicationEndpoint) if err != nil { - if err.(*APIError).status == 404 { + var apiErr *APIError + if errors.As(err, &apiErr) && apiErr.status == 404 { return replications, nil } return replications, err