Improve the error handling

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>
Restructured the large file download (not finished yet)

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>