Skip to content

Update Wiz to allow API errors#257

Open
0BL1V10N-55 wants to merge 1 commit into
refractionPOINT:masterfrom
0BL1V10N-55:wiz_error_debug
Open

Update Wiz to allow API errors#257
0BL1V10N-55 wants to merge 1 commit into
refractionPOINT:masterfrom
0BL1V10N-55:wiz_error_debug

Conversation

@0BL1V10N-55
Copy link
Copy Markdown

Description of the change

Added GraphQL error handling: The code now checks for errors in the GraphQL response before processing the data. If errors are present, it returns a descriptive error message.

Added nil checks: When traversing the data path, if any element is nil, the code now returns an empty result instead of failing with an error. This handles cases where the API returns a valid response but with no data (e.g., {"data": null}).

Improved error messages: Added the actual value to the error message to help with debugging.

The error you were seeing ("expected object at path data, got ") was likely caused by the Wiz API returning either:

A GraphQL error in the response
A null data field (e.g., {"data": null})
Now the adapter will handle these cases gracefully by either reporting the GraphQL error or continuing to poll without crashing.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • [X ] New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Added GraphQL error handling: The code now checks for errors in the GraphQL response before processing the data. If errors are present, it returns a descriptive error message.

Added nil checks: When traversing the data path, if any element is nil, the code now returns an empty result instead of failing with an error. This handles cases where the API returns a valid response but with no data (e.g., {"data": null}).

Improved error messages: Added the actual value to the error message to help with debugging.

The error you were seeing ("expected object at path data, got <nil>") was likely caused by the Wiz API returning either:

A GraphQL error in the response
A null data field (e.g., {"data": null})
Now the adapter will handle these cases gracefully by either reporting the GraphQL error or continuing to poll without crashing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant