Skip to content

Commit

Permalink
SOAR-15940-adding more specific error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rbowden-r7 committed Nov 10, 2023
1 parent 1d781b4 commit 17343a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/rapid7_insightidr/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ Example output:
# Version History

* 6.0.2 - Action: `Advanced Query On Log set` - Fixed error where statistical queries would always return 0.0
* 6.0.1 - Action: `Advanced Query On Log` - Up the maximium events returned from 50 to 500
* 6.0.1 - Action: `Advanced Query On Log` - Increase the maximum results returned from 50 to 500
* 6.0.0 - Action: `Advanced Query On Log Set` - Add new output type for statistical queries.
* 5.1.2 - Action: `Advanced Query on Log Set` - Fix JSONDecoderError | Action: `Query` - Update spec and help.md to show it queries log IDs, not query IDs
* 5.1.1 - Action: `List Investigations` - Now receiving size input | Actions: `Advanced Query On Log` & `Advanced Query On Log Set` - Acronym LQL has been updated to LEQL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from komand_rapid7_insightidr.util.resource_helper import ResourceHelper
from insightconnect_plugin_runtime.exceptions import PluginException
from komand_rapid7_insightidr.util.parse_dates import parse_dates
from requests import HTTPError


class AdvancedQueryOnLogSet(insightconnect_plugin_runtime.Action):
Expand Down Expand Up @@ -181,11 +182,11 @@ def maybe_get_log_entries(
stats_response = self.connection.session.get(stats_endpoint, params=params)
try:
stats_response.raise_for_status()
except Exception:
except HTTPError as error:
raise PluginException(
cause="Failed to get log sets from InsightIDR\n",
assistance=f"Could not get statistical info from: {stats_endpoint}\n",
data=stats_response.text,
data=f"{stats_response.text}, {error}",
)
potential_results = stats_response.json()
else:
Expand Down

0 comments on commit 17343a6

Please sign in to comment.