changed logs to returned errors

This commit is contained in:
StephenButtolph 2020-05-30 16:04:40 -04:00
parent 4142160b8c
commit 1abf68cee2
1 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ func (service *Service) GetCurrentValidators(_ *http.Request, args *GetCurrentVa
case *addDefaultSubnetDelegatorTx:
address = tx.Destination
default: // Shouldn't happen
service.vm.Ctx.Log.Debug("unexpected type in currentValidators list")
return fmt.Errorf("couldn't get the destination address of %s", tx.ID())
}
reply.Validators[i] = APIValidator{
@ -215,7 +215,7 @@ func (service *Service) GetPendingValidators(_ *http.Request, args *GetPendingVa
case *addDefaultSubnetDelegatorTx:
address = tx.Destination
default: // Shouldn't happen
service.vm.Ctx.Log.Debug("unexpected type in currentValidators list")
return fmt.Errorf("couldn't get the destination address of %s", tx.ID())
}
reply.Validators[i] = APIValidator{
ID: vdr.ID(),