join: Throw CommandError instead of Exception for simple errors
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 16 Jan 2019 02:37:00 +0000 (15:37 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 16 Jan 2019 21:11:04 +0000 (22:11 +0100)
commit9e4b08f4c384b8cae5ad853a7be7cf03e2749be5
treefbe6728eb1552f7dac42635a99a9fd525cbf54ec
parent3bb7808984c163a7bba66fb983411d1281589722
join: Throw CommandError instead of Exception for simple errors

Throwing an exception here still dumps out the Python stack trace, which
can be a little disconcerting for users.

In this case, the stack trace isn't going to really help at all (the
problem is pretty obvious), and it obscures the useful message
explaining what went wrong.

Throw a CommandError instead, which samba-tool will catch and display
more nicely.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13747

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Jeremy Allison <rpenny@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 16 22:11:04 CET 2019 on sn-devel-144
python/samba/join.py