naggie / dsnet

FAST command to manage a centralised wireguard VPN. Think wg-quick but quicker: key generation + address allocation.
https://calbryant.uk/blog/how-to-set-up-a-wireguard-vpn-in-minutes-with-dsnet/
MIT License
673 stars 33 forks source link

Error cascade #76

Closed xxxserxxx closed 1 month ago

xxxserxxx commented 2 years ago

This version (which can be merged on top of, or instead of, report_errors) replaces ExitFail() in the top-level functions, such that errors are passed up to the main function and reported there. Long-term, ExitFail() would ideally be removed entirely; by exiting deep in the stack, it prevents calling functions the opportunity to handle and clean up after errors. However, this PR focuses on having consistent behavior in all of the top-level commands by using RunE() wherever there can be failures.

xxxserxxx commented 2 years ago

All of these PRs are based on different branches, and they often conflict. If you're going to pull any of them, I recomend pulling issue-69 and user-keys-master first, then letting me know which others you do (or don't) want to merge, and letting me resolve the conflicts.

naggie commented 2 years ago

Thanks @xxxserxxx -- I will get the user-keys-master branch merged first I think. A useful change and helps @botto 's plight of separating the cli into a lib. @botto please take a look too.

xxxserxxx commented 1 year ago

Rebased naggie/master onto this so it's a clean merge again.

naggie commented 1 month ago

@xxxserxxx would you mind resolving the build issue here pls? Feel free to revert my bad merge.

xxxserxxx commented 1 month ago

@xxxserxxx would you mind resolving the build issue here pls? Feel free to revert my bad merge.

Yah, no problem.

xxxserxxx commented 1 month ago

Man, I hate git.

I created a new branch, error_cascade_clean, that I'll open a new PR for.