arthurnn / memcached

A Ruby interface to the libmemcached C client
Academic Free License v3.0
432 stars 127 forks source link

TypeError on unexpected return code #75

Closed gcampbell closed 12 years ago

gcampbell commented 12 years ago

The following line (currently line 613 in lib/memcached/memcached.rb) will attempt to raise nil if EXCEPTIONS[ret] doesn't exist, which results in a TypeError: "exception class/object expected". I'd like to submit a patch that will instead raise a more informative Memcached::Error that includes the unexpected code in the message.

raise EXCEPTIONS[ret], message
gcampbell commented 12 years ago

I created Issue #76 as a pull request.