Fixed wrong Exception being thrown

This schould be an IOException