uploadFile throws an exception (message and code) if the API returned an error