js: throw errors in sync functions
- synchronous functions should throw errors if something goes wrong, Promises should reject. This commit changes some error cases that returned Error objects instead of throwing them
- src/Key.js: createKey() and sync Key.get() throw errors
- src/Error.js: Exporting the list of errors to be able to test and compare against these strings
- src/Keyring.js: Setting a null value in pattern is not useful, and now caused an error with the new changes.
- src/Message.js: createMessage and Message.setParameter now throw errors