From c6935c436ab28c6879b03907604908292dd81a42 Mon Sep 17 00:00:00 2001 From: Gon Bogner Date: Mon, 24 Aug 2026 14:52:52 +0300 Subject: [PATCH] fix: show the real failure reason on offline scan upload errors Echo the server's HTTP error (including its error message) and point at the expected scan directory layout when scanner_info.json is missing, instead of only printing a generic unexpected-error message. Co-Authored-By: Claude Fable 5 --- CHANGES | 4 ++++ intezer_analyze_cli/__init__.py | 2 +- intezer_analyze_cli/commands.py | 10 +++++++++ tests/unit/commands_test.py | 36 +++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index f6b5847..5fcef2d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1.16.1 +----- +- Show the server's error reason and missing scan file details when an offline endpoint scan upload fails + 1.16.0 ----- - alerts-data-sources deactivate-batch: deactivate multiple alert data sources concurrently, either from a text file of connector IDs (`--config`) or every connector currently in `active`/`offline`/`update_failed` (`--all-active`) diff --git a/intezer_analyze_cli/__init__.py b/intezer_analyze_cli/__init__.py index 20f9c7e..4b2887f 100644 --- a/intezer_analyze_cli/__init__.py +++ b/intezer_analyze_cli/__init__.py @@ -1 +1 @@ -__version__ = '1.16.0' +__version__ = '1.16.1' diff --git a/intezer_analyze_cli/commands.py b/intezer_analyze_cli/commands.py index af5817c..7de1d07 100644 --- a/intezer_analyze_cli/commands.py +++ b/intezer_analyze_cli/commands.py @@ -5,6 +5,7 @@ from email.utils import parsedate_to_datetime import click +import requests from intezer_sdk import api from intezer_sdk import consts as sdk_consts from intezer_sdk import errors as sdk_errors @@ -310,6 +311,15 @@ def upload_offline_endpoint_scan(offline_scan_directory: str, force: bool = Fals click.echo(f'Analyze error: {e}') logger.exception('Failed to analyze offline scan') raise + except requests.HTTPError as error: + click.echo(f'Upload failed: {error}') + logger.exception('Failed to upload offline scan') + raise + except FileNotFoundError as error: + click.echo(f'Missing scan file: {error.filename}. Make sure the path is the scan output directory ' + 'created by the scanner (scan___