Closed nzbart closed 4 years ago
Is this something that you'd be interested in me submitting a pull request for...
Definitely! :+1:
...and if so, how would you recommend I implement it?
That's a good question.
I was thinking about the same approach a few days ago, because of #47.
This is a similar problem and it affects exactly the LogMailingScmBackup
you mentioned - this class would need the true/false value in order to send different mail texts depending on the result.
I agree, the bool
return value looks clunky somehow, but right now, I don't have a better idea.
But I don't have that much experience with designs like this, though - that's one reason why I'm making open source projects like this one.
Do you have a different idea?
Fixed by #54
For use in scripts, it would be handy to have the process exit with zero on success and nonzero on failure.
I had a quick stab at this, but it wasn't immediately clear how it would best be done. My initial approach was to alter
IScmBackup.Run
to returnbool
, which would be true on success and false on failure. However, this approach isn't perfect due to the use of the decorator pattern where - for example -LogMailingScmBackup
wrapsScmBackup
. Currently, errors are bubbled through the layers of decorators by throwing exceptions, and it's a little clunky to also return a true/false value.Is this something that you'd be interested in me submitting a pull request for, and if so, how would you recommend I implement it?