bugfix: exception message was not printed

Also, added javadoc comments.