Permalink
Browse files

Fix broken control flow of example in README.

  • Loading branch information...
1 parent ae57bf9 commit 5e24ff7126895c4c1981da46e43c0e1a9f0e3eea @evnm committed Nov 18, 2010
Showing with 13 additions and 11 deletions.
  1. +13 −11 README.md
View
@@ -51,17 +51,19 @@ Here's an example where we upload a file and remotely move it around before dele
// Upload foo.txt to the Dropbox root directory.
dropbox.putFile('foo.txt', '', function(err, data) {
- if (err) console.log('Error: ' + sys.inspect(err));
- });
-
- // Move it into the Public directory.
- dropbox.move('foo.txt', 'Public/foo.txt', function(err, data) {
- if (err) console.log('Error: ' + sys.inspect(err));
- });
-
- // Delete the file.
- dropbox.deleteItem('Public/foo.txt', function(err, data) {
- if (err) console.log('Error: ' + sys.inspect(err));
+ if (err) console.error(err.stack);
+ else {
+ // Move it into the Public directory.
+ dropbox.move('foo.txt', 'Public/foo.txt', function(err, data) {
+ if (err) console.error(err.stack);
+ else {
+ // Delete the file.
+ dropbox.deleteItem('Public/foo.txt', function(err, data) {
+ if (err) console.error(err.stack);
+ });
+ }
+ });
+ }
});
## Testing

0 comments on commit 5e24ff7

Please sign in to comment.