ducky/devices

Paddy 2015-11-27 Parent:74dbc04879a7 Child:03c49b4d3d9f

11:683050b4546b Go to Latest

ducky/devices/memstore.go

Return ErrDeviceNotFound when updating devices. If we can't find the Device we're supposed to update, return an ErrDeviceNotFound error. Write a unit test that tests for this behaviour.

History
     1.1 --- a/memstore.go	Fri Nov 27 10:37:27 2015 -0800
     1.2 +++ b/memstore.go	Fri Nov 27 11:32:15 2015 -0800
     1.3 @@ -40,7 +40,7 @@
     1.4  
     1.5  	device, ok := m.devices[change.DeviceID.String()]
     1.6  	if !ok {
     1.7 -		return nil // TODO: return an error
     1.8 +		return ErrDeviceNotFound
     1.9  	}
    1.10  
    1.11  	device = ApplyChange(device, change)