Replaced direct logging with exceptions

Library should not log anything on it's own, so the logging was replaced with throwing the exception.