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:
@@ -103,11 +103,11 @@ func (c *exoscaleProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
|
||||
rec.SetTarget(r.Content)
|
||||
case "MX":
|
||||
if err := rec.SetTargetMX(uint16(r.Prio), r.Content); err != nil {
|
||||
panic(fmt.Errorf("unparsable record received from exoscale: %w", err))
|
||||
return nil, fmt.Errorf("unparsable record received from exoscale: %w", err)
|
||||
}
|
||||
default:
|
||||
if err := rec.PopulateFromString(r.RecordType, r.Content, dc.Name); err != nil {
|
||||
panic(fmt.Errorf("unparsable record received from exoscale: %w", err))
|
||||
return nil, fmt.Errorf("unparsable record received from exoscale: %w", err)
|
||||
}
|
||||
}
|
||||
existingRecords = append(existingRecords, rec)
|
||||
|
Reference in New Issue
Block a user