Fixed indention
Improved error handling
Improved error output
Throw error when upload failes
Build