From 038d43226471de1d60fd113211216830185b8c81 Mon Sep 17 00:00:00 2001 From: Antonio Emmanuel Guerrero Silva Date: Wed, 20 Nov 2024 23:33:39 -0600 Subject: [PATCH] refs #1164 ogRaiseError function call correction --- client/lib/engine/bin/FileLib.py | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/client/lib/engine/bin/FileLib.py b/client/lib/engine/bin/FileLib.py index 6099dee..424c17a 100755 --- a/client/lib/engine/bin/FileLib.py +++ b/client/lib/engine/bin/FileLib.py @@ -271,12 +271,20 @@ def ogDeleteTree(*args): # Comprobar que existe el directorio y borrarlo con su contenido. DIR = ogGetPath(*args) if not DIR: - SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args) + SystemLib.ogRaiseError( + "session", + ogGlobals.OG_ERR_NOTFOUND, + f"Not found: {args}" + ) return try: shutil.rmtree(DIR) except OSError as e: - SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args) + SystemLib.ogRaiseError( + "session", + ogGlobals.OG_ERR_NOTFOUND, + f"{e}" + ) return @@ -401,10 +409,18 @@ def ogIsNewerFile(*args): # Comprobar que existen los ficheros origen y destino. if not SOURCE: - SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args[:-1]) + SystemLib.ogRaiseError( + "session", + ogGlobals.OG_ERR_NOTFOUND, + f"Not found: {args[:-1]}" + ) return if not TARGET: - SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args) + SystemLib.ogRaiseError( + "session", + ogGlobals.OG_ERR_NOTFOUND, + f"Not found: {args[-1]}" + ) return # Devolver si el primer fichero se ha modificado después que el segundo. @@ -420,7 +436,11 @@ def ogMakeChecksumFile(*args): # Comprobar que existe el fichero y guardar su checksum. FILE = ogGetPath(*args) if not FILE: - SystemLib.ogRaiseError(OG_ERR_NOTFOUND, *args) + SystemLib.ogRaiseError( + "session", + ogGlobals.OG_ERR_NOTFOUND, + f"Not found: {args}" + ) return checksum = ogCalculateChecksum(FILE) with open(f"{FILE}.sum", "w") as f: