Raising IOError for java errors