[POC] Better upload error handling?

The aim here is to make handling upload errors easier by throwing
meaningful exceptions.

At the moment the dev will always need to translate the UPLOAD_ERR_*
constants into messages manually.

I have proposed two changes.