Don't print in the library - this removed the application/program that uses the library ability to control the output created.. Put the error message into the exception and throw it along.