If you throw something it should be an instance of `Error` class - `throw new Error(msg);`.

Throwing regular object or string is nasty and breaks a lot of things which rely on `instanceof Error`.