shill: allow property accessors to return an error message if a
property's value cannot be changed.

also, reduce some code duplication in property_store.cc

BUG=chromium-os:21384
TEST=unittests

Change-Id: Iaac8d40bbb9e9a1341d6c6d01642885d88ac0e27
Reviewed-on: http://gerrit.chromium.org/gerrit/8925
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/accessor_interface.h b/accessor_interface.h
index 3a62696..7186a54 100644
--- a/accessor_interface.h
+++ b/accessor_interface.h
@@ -15,6 +15,8 @@
 
 namespace shill {
 
+class Error;
+
 // A templated abstract base class for objects that can be used to access
 // properties stored in objects that are meant to be made available over RPC.
 // The intended usage is that an object stores a maps of strings to
@@ -28,8 +30,8 @@
 
   // Provides read-only access.
   virtual const T &Get() = 0;
-  // Attempts to set the wrapped value.  Returns true upon success.
-  virtual bool Set(const T &value) = 0;
+  // Attempts to set the wrapped value. Sets |error| on failure.
+  virtual void Set(const T &value, Error *error) = 0;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(AccessorInterface);