Merged
Conversation
Added message field if is_error=yes
test: fix regex to handle multiline JSON output in error messages
Contributor
Author
hkantare
approved these changes
Mar 2, 2026
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.


Community Note
Relates OR Closes #0000
Output from acceptance testing:
Summary
This PR enhances error handling in the resource tagging functionality and updates the platform-services-go-sdk dependency to v0.94.3. The main improvement is that error messages now include detailed information from all result fields (resource_id, is_error, and message) instead of only showing failed items, providing better debugging capabilities for users.
Changes
1. Enhanced Error Handling in Resource Tagging
File:
ibm/service/globaltagging/resource_ibm_resource_tag.gohasErrors)results.ResultsandfullResponseto provide comprehensive error informationBefore:
After:
File: ibm/service/globaltagging/resource_ibm_resource_tag_test.go
Updated TestAccResourceTag_FakeCrnExpectingError to verify that error output includes the message field:
The regex now:
Uses (?s) flag to handle multiline JSON output
Verifies presence of both is_error and message fields
Ensures the enhanced error format is working correctly
3. Dependency Update
Files: go.mod, go.sum
Updated github.com/IBM/platform-services-go-sdk from v0.94.2 to v0.94.3
Cleaned up unused indirect dependencies via go mod tidy
Benefits
Better Debugging: Error messages now show complete operation results with detailed messages, not just failures
Performance: Early exit on first error instead of iterating through all results
Maintainability: Cleaner, more readable code
SDK Alignment: Updated to latest platform-services-go-sdk version
Example Error Output
Before (only failed items):
After (all results with message):
Testing
Code Quality Checks
All checks passed:
Test validates:
✅ Error output includes "is_error": true
✅ Error output includes "message" field with detailed error information
✅ Enhanced error format provides better debugging information for users
Breaking Changes
None - changes are backward compatible