code: func DeviceIDExists(err error) bool {
  	return fmt.Sprint(err) == fmt.Sprint(ErrDeviceIDExists)
  }
docs: // DeviceIDExists returns whether error conveys the information about device Id already
  // exist or not. This will be true if device creation or snap creation
  // operation fails if device or snap device already exists in pool.
  // Current implementation is little crude as it scans the error string
  // for exact pattern match. Replacing it with more robust implementation
  // is desirable.