Fix/upload dry

Refactored set_error().

I thought I submitted a pull request for this 21 days ago, but apparently, I didn't... D'oh!