Repository navigation
fix(gti-mcp): keep the API error message when updating collection IOCs - #348
Open
VISHNU0906 wants to merge 1 commit into
Open
VISHNU0906 wants to merge 1 commit into
VISHNU0906 wants to merge 1 commit into
Conversation
update_iocs_in_collection returned a bare 'Error updating collection' for any non-200 response, so a missing collection or a permission error looked the same to the caller. Include the GTI error message (or code) through the same _api_error helper the other collection tools use, and read the status from the public ClientResponse attribute. Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
update_iocs_in_collectionanswered every non-200 response with a bareError updating collection, so a missing collection, a 403 or a bad IOC all looked the same to the agent calling it. This is the same gap #345 closed forcreate_collectionandupdate_collection_attributes.It now keeps the GTI reason through the existing
_api_errorhelper:A non-JSON error body (a proxy page, say) still gives
Error updating collection: API Error: Unknown error. The success string is unchanged, and the status now comes from the publicres.statusinstead ofres._aiohttp_resp.status.Tests go through
call_toolwith pytest-httpserver: a 404 on add, a 403 on remove (code only), and a 502 HTML body. All three fail on main; the full gti suite passes locally (82 tests).@dandye