diff --git a/src/uipath/_cli/_auth/_client_credentials.py b/src/uipath/_cli/_auth/_client_credentials.py index b6042d2b..3e3f0385 100644 --- a/src/uipath/_cli/_auth/_client_credentials.py +++ b/src/uipath/_cli/_auth/_client_credentials.py @@ -106,11 +106,20 @@ def authenticate( "refresh_token": "", "id_token": "", } + case 400: + try: + error_details = response.json() + console.info(f"DEBUG: Error details: {error_details}") + except Exception: + console.info(f"DEBUG: Raw error response: {response.text}") + console.error( "Invalid client credentials or request parameters." ) + return None + case 401: console.error("Unauthorized: Invalid client credentials.") return None diff --git a/src/uipath/_cli/cli_run.py b/src/uipath/_cli/cli_run.py index 62a6bb1b..93f09702 100644 --- a/src/uipath/_cli/cli_run.py +++ b/src/uipath/_cli/cli_run.py @@ -62,9 +62,13 @@ def python_run_middleware( try: async def execute(): - context = UiPathRuntimeContext.from_config( - env.get("UIPATH_CONFIG_PATH", "uipath.json") - ) + config_path = env.get("UIPATH_CONFIG_PATH", "uipath.json") + console.info(f"[DEBUG] Using config path: {config_path}") + console.info(f"[DEBUG] Entrypoint argument: {entrypoint}") + console.info(f"[DEBUG] Entrypoint absolute path: {os.path.abspath(entrypoint) if entrypoint else None}") + console.info(f"[DEBUG] Entrypoint exists: {os.path.exists(entrypoint) if entrypoint else None}") + console.info(f"[DEBUG] Input: {input}") + context = UiPathRuntimeContext.from_config(config_path) context.entrypoint = entrypoint context.input = input context.resume = resume @@ -93,6 +97,7 @@ async def execute(): return MiddlewareResult(should_continue=False) except UiPathRuntimeError as e: + console.info(f"[DEBUG][UiPathRuntimeError] {type(e).__name__}: {e}") return MiddlewareResult( should_continue=False, error_message=f"Error: {e.error_info.title} - {e.error_info.detail}", @@ -100,6 +105,7 @@ async def execute(): ) except Exception as e: # Handle unexpected errors + console.info(f"[DEBUG][Exception] {type(e).__name__}: {e}") return MiddlewareResult( should_continue=False, error_message=f"Error: Unexpected error occurred - {str(e)}",