20937: Simplify use of logger.error
authorPeter Amstutz <peter.amstutz@curii.com>
Wed, 11 Oct 2023 13:19:24 +0000 (09:19 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Wed, 11 Oct 2023 13:19:24 +0000 (09:19 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/python/arvados/commands/arv_copy.py

index 494f2e29b6b574b21df2a113f729bfc647b95210..7326840896a50c371df463114cfceb6ac98ef3f2 100755 (executable)
@@ -164,10 +164,7 @@ def main():
         else:
             abort("cannot copy object {} of type {}".format(args.object_uuid, t))
     except Exception as e:
-        if args.verbose:
-            logger.exception("%s", e)
-        else:
-            logger.error("%s", e)
+        logger.error("%s", e, exc_info=args.verbose)
         exit(1)
 
     # Clean up any outstanding temp git repositories.