better file error handling

Signed-off-by: TheTesla <stefan.helmert@gmx.net>