Closed heffergm closed 8 years ago
Two things:
1) The code has retry hooks at the end on the grounds that AWS/S3 is expected to fail at least once during a batch:
https://github.com/whosonfirst/go-whosonfirst-clone/blob/master/clone.go#L162-L168
2) But yes, it should behave list a proper CLI tool assuming the retry code fails
Okay, so there is this:
https://github.com/whosonfirst/go-whosonfirst-clone/compare/exit
Can you rebuild from the exit
branch and let me know if this accomplishes what you're after? Specifically you can pass the wof-clone-metafile
binary a -strict
flag which will exit 1
if anything fails.
Perfect, you rock.
grant: ~/.../whosonfirst/go-whosonfirst-clone (exit)$ ./bin/wof-clone-metafiles -strict -dest ../data/ ../blah
[wof-clone-metafiles] 13:58:07.841550 [error] Failed to read /Users/grant/repos/whosonfirst/blah, because open /Users/grant/repos/whosonfirst/blah: no such file or directory
[wof-clone-metafiles] 13:58:07.841699 [error] failed to clone ../blah, because open /Users/grant/repos/whosonfirst/blah: no such file or directory
grant: ~/.../whosonfirst/go-whosonfirst-clone (exit)$ echo $?
1
Okay, I will merge with master
just as soon as I finish commenting on this other issue ;-)
tasteful muzak plays
Now in master.
In the below example,
blah
is non-existent. I'd expect some non-zero exit status if the requested file I'm requesting be loaded doesn't exist.