Add error handling by raising Ruby exception classes.

If a script returns an error, convert it to the proper exception class. The error message is expected to be of the format <class>:<message>.