Add exception handling to the library

This pull request adds exception handling to the library. Instead of silently ignoring errors like "NO DATA" or crashing on others, an unchecked exception will be thrown. This may break code that uses this library and expects the current behavior but makes responding to errors more straight forward.