Improve error handing.

Add max retry when upload failed.
Add error handling.
Remove some console.log().
Fix: Don't start monitor if `self.monitor` is false.