maatma: display the error returned by knotc instead of generic command error
This commit is contained in:
parent
b8179583e6
commit
7bfed9dc89
@ -201,8 +201,8 @@ func (student Student) AddAssociatedDomains() (err error) {
|
|||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
log.Printf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error())
|
||||||
log.Println(string(out))
|
err = errors.New(string(out))
|
||||||
runKnotc("zone-abort", AssociatedDomainSuffix)
|
runKnotc("zone-abort", AssociatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -245,8 +245,8 @@ func (student Student) AddNSDelegatedDomain(dn string, ttl uint64, ns string) (e
|
|||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil && cmd[0] != "zone-unset" {
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
log.Printf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error())
|
||||||
log.Println(string(out))
|
err = errors.New(string(out))
|
||||||
runKnotc("zone-abort", DelegatedDomainSuffix)
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -267,8 +267,8 @@ func (student Student) UpdateNSDelegatedDomain(dn string, ttl uint64, oldns stri
|
|||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil && cmd[0] != "zone-unset" {
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
log.Printf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error())
|
||||||
log.Println(string(out))
|
err = errors.New(string(out))
|
||||||
runKnotc("zone-abort", DelegatedDomainSuffix)
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -301,8 +301,8 @@ func (student Student) AddGLUEDelegatedDomain(dn string, ttl uint64, aaaa string
|
|||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil && cmd[0] != "zone-unset" {
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
log.Printf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error())
|
||||||
log.Println(string(out))
|
err = errors.New(string(out))
|
||||||
runKnotc("zone-abort", DelegatedDomainSuffix)
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -335,8 +335,8 @@ func (student Student) UpdateGLUEDelegatedDomain(dn string, ttl uint64, oldaaaa
|
|||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil && cmd[0] != "zone-unset" {
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
log.Printf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error())
|
||||||
log.Println(string(out))
|
err = errors.New(string(out))
|
||||||
runKnotc("zone-abort", DelegatedDomainSuffix)
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -384,8 +384,8 @@ func (student Student) AddDSDelegatedDomain(dn string, ttl uint64, dnskey []stri
|
|||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil && cmd[0] != "zone-unset" {
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
log.Printf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error())
|
||||||
log.Println(string(out))
|
err = errors.New(string(out))
|
||||||
runKnotc("zone-abort", DelegatedDomainSuffix)
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -406,8 +406,8 @@ func (student Student) UpdateDSDelegatedDomain(dn string, ttl uint64, oldds []st
|
|||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil && cmd[0] != "zone-unset" {
|
if err != nil && cmd[0] != "zone-unset" {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
log.Printf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error())
|
||||||
log.Println(string(out))
|
err = errors.New(string(out))
|
||||||
runKnotc("zone-abort", DelegatedDomainSuffix)
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -443,8 +443,8 @@ func (student Student) DeleteRRDelegatedDomain(dn string, rr string, values ...s
|
|||||||
var out []byte
|
var out []byte
|
||||||
out, err = runKnotc(cmd...)
|
out, err = runKnotc(cmd...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = errors.New(fmt.Sprintf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error()))
|
log.Printf("An error occurs on command '%s': %s", strings.Join(cmd, " "), err.Error())
|
||||||
log.Println(string(out))
|
err = errors.New(string(out))
|
||||||
runKnotc("zone-abort", DelegatedDomainSuffix)
|
runKnotc("zone-abort", DelegatedDomainSuffix)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user