Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull: relay along errors encountered #737

Merged
merged 1 commit into from
Sep 15, 2016
Merged

Conversation

odeke-em
Copy link
Owner

Fixes #734.

Capture errors after parallelized pulls.
Also avoid shadowing errors on result waiting.

The changed code was legacy of an oversight after the old days
in which we didn't send back exit codes to the outside world.
After exit codes were added to drive, the pull code was never touched.
Even still though, we had logging for errors and users could see their
errors.

Exhibits:

  • Unsuccessful pull
 drive pull --export pdf,rtf t1; echo $?
Resolving...
$ drive pull --export pdf,rtf t1; echo $?
Resolving...
M /test-docs/t1
Modification count 1
yroceed with the changes? [Y/n]: –
/test-docs/t1 err: download: failed for url "". StatusCode: 400
download: failed for url "". StatusCode: 400
255
  • Successful pull
$ drive pull --export pdf,rtf t1; echo $?
Resolving...
M /test-docs/t1
Modification count 1
Proceed with the changes? [Y/n]:y
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-docs/t1' to '/Users/emmanuelodeke/emm.odeke@gmail.com/test-docs/t1_exports/t1.rtf'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-docs/t1' to '/Users/emmanuelodeke/emm.odeke@gmail.com/test-docs/t1_exports/t1.pdf'
0

Fixes #734.

Capture errors after parallelized pulls.
Also avoid shadowing errors on result waiting.

The changed code was legacy of an oversight after the old days
in which we didn't send back exit codes to the outside world.
After exit codes were added to drive, the pull code was never touched.
Even still though, we had logging for errors and users could see their
errors.

Exhibits:
* Unsuccessful pull
```shell
 drive pull --export pdf,rtf t1; echo $?
Resolving...
$ drive pull --export pdf,rtf t1; echo $?
Resolving...
M /test-docs/t1
Modification count 1
yroceed with the changes? [Y/n]: –
/test-docs/t1 err: download: failed for url "". StatusCode: 400
download: failed for url "". StatusCode: 400
255
```

* Successful pull
```shell
$ drive pull --export pdf,rtf t1; echo $?
Resolving...
M /test-docs/t1
Modification count 1
Proceed with the changes? [Y/n]:y
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-docs/t1' to '/Users/emmanuelodeke/emm.odeke@gmail.com/test-docs/t1_exports/t1.rtf'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-docs/t1' to '/Users/emmanuelodeke/emm.odeke@gmail.com/test-docs/t1_exports/t1.pdf'
0
```
@odeke-em odeke-em merged commit 3ce15a9 into master Sep 15, 2016
@odeke-em odeke-em deleted the pull-relay-back-errors branch September 17, 2016 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant