Skip to content

Commit

Permalink
Merge pull request #246 from Juniper/245-update-error-handling-for-cl…
Browse files Browse the repository at this point in the history
…ientgo-unsupported-api-version

update err returned if experimental is not set
  • Loading branch information
bwJuniper committed Mar 29, 2024
2 parents 18fb90b + 87eb01f commit 9ba1bd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apstra/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ func (o ClientCfg) NewClient(ctx context.Context) (*Client, error) {
msg := fmt.Sprintf("unsupported API version: '%s'", c.apiVersion)
c.logStr(0, msg)
if !c.cfg.Experimental {
return nil, errors.New(msg)
return nil, ClientErr{
errType: ErrCompatibility,
err: errors.New(msg),
}
}
}

Expand Down

0 comments on commit 9ba1bd6

Please sign in to comment.