mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
MAINTENANCE: Unknown rtypes should return errors, not a panic (#945)
* Eliminate panics related to unknown rtypes
This commit is contained in:
@@ -257,9 +257,7 @@ func toReq(rc *models.RecordConfig) (requestParams, error) {
|
||||
req["algorithm"] = strconv.Itoa(int(rc.SshfpAlgorithm))
|
||||
req["fptype"] = strconv.Itoa(int(rc.SshfpFingerprint))
|
||||
default:
|
||||
msg := fmt.Sprintf("ClouDNS.toReq rtype %v unimplemented", rc.Type)
|
||||
panic(msg)
|
||||
// We panic so that we quickly find any switch statements
|
||||
return nil, fmt.Errorf("ClouDNS.toReq rtype %q unimplemented", rc.Type)
|
||||
}
|
||||
|
||||
return req, nil
|
||||
|
Reference in New Issue
Block a user