From: Rishabh Dave Date: Tue, 1 Oct 2019 06:39:39 +0000 (+0530) Subject: cephfs-shell: catch libcephfs.Error only in onecmd() X-Git-Tag: v15.1.0~953^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=845f5c613be13edcda863917c146f197d2229f01;p=ceph.git cephfs-shell: catch libcephfs.Error only in onecmd() Instead of catching it in every method. Signed-off-by: Rishabh Dave --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index d672f02c538..34d5366a507 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -409,6 +409,10 @@ class CephFSShell(Cmd): perror('***\n{}'.format(e)) except KeyboardInterrupt: perror('Command aborted') + except libcephfs.Error as e: + perror(e.strerror) + if shell.debug: + traceback.print_exc(file=sys.stdout) except Exception as e: perror(e) traceback.print_exc(file=sys.stdout)