replaced `IllegalArgumentException` with `Error`

There is no `IllegalArgumentException` in JS.
Merge pull request #108 from fb55/patch-1

Replaced `IllegalArgumentException` with `Error`