flipback/rmodbus — Issue #15: Bug in raise exception 
Author: flipback
Created: 2011-10-29 15:02:10+00:00
State: open
Labels: Bug

This code is not valid.

```ruby
require "rmodbus"

s = ModBus::TCPServer.new(9999, 1)
s.holding_registers = [1] * 10
s.start

ModBus::TCPClient.connect('127.0.0.1',9999) do |cl|
cl.with_slave(1) do |slave|
slave.holding_registers[0..2] = [0,0]
end
end

s.stop
```

But it has raised unexpected exception instead of `ModBus::Errors::ProxyException`

```
/home/flipback/.rvm/gems/ruby-1.9.2-p290/gems/rmodbus-1.1.0/lib/rmodbus/proxy.rb:44:in `[]=': uninitialized constant ModBus::ReadWriteProxy::ProxyException (NameError)
from test_rmd.rb:13:in `block (2 levels) in

'
from /home/flipback/.rvm/gems/ruby-1.9.2-p290/gems/rmodbus-1.1.0/lib/rmodbus/client.rb:66:in `with_slave'
from test_rmd.rb:8:in `block in

'
from /home/flipback/.rvm/gems/ruby-1.9.2-p290/gems/rmodbus-1.1.0/lib/rmodbus/client.rb:39:in `initialize'
from test_rmd.rb:7:in `new'
from test_rmd.rb:7:in `

'
```