def on_error(obj=nil, &block)
      @on_error_obj = obj
      @on_error = Proc.new { |handle, obj_ptr, code, description|
        yield self, object_for(obj_ptr), code, description
      }
      Phidgets::FFI::Common.set_OnError_Handler(@handle, @on_error, pointer_for(obj))
	  true
    end
def on_error(obj=nil, &block)
      @on_error_obj = obj
      @on_error = Proc.new { |handle, obj_ptr, code, description|
        yield self, object_for(obj_ptr), code, description
      }
      Phidgets::FFI::Common.set_OnError_Handler(@handle, @on_error, pointer_for(obj))
	  true
    end
Sets an error handler callback function. This is called when an asynchronous error occurs. This is generally used for network errors, and device hardware error messages.

 @param [String] obj Object to pass to the callback function. This is optional.
 @param [Proc] Block When the callback is executed, the device and object are yielded to this block.
 @example
     ifkit.on_error do |device, obj, code, description|
       puts "Error - code #{code}, description #{description}"
     end
 As this runs in it's own thread, be sure that all errors are properly handled or the thread will halt and not fire any more.
 @return [Boolean] returns true or raises an error