Make error handling code more resilient.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Make error handling in the File() function more resilient.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>