change uses of throw to raise

'throw' is for escaping from control flow, whereas 'raise' is for
error conditions, e.g.

http://rubylearning.com/blog/2011/07/12/throw-catch-raise-rescue-im-so-confused/
Merge pull request #1718 from aspiers/topic/use-raise-not-throw

change uses of throw to raise