Strings should not be thrown directly

Most js code is expecting a full Error object not a string. Throwing strings directly is not considered to be a good practice overall.