upload.notify_error fix- obtain stacktrace first

before doing anything else that might create a second stack trace
that hides the original error
(cherry picked from commit a9323f73a4a58ff6279e2f7c59f54ef2b5d55c40)