Report error from target file

Fix issue #779