Skip to content

Unwrap scim errors when possible for patch validation#187

Merged
q-uint merged 1 commit intoelimity-com:masterfrom
Achooo:ash/issue-186-fix-patch-errors
Mar 24, 2026
Merged

Unwrap scim errors when possible for patch validation#187
q-uint merged 1 commit intoelimity-com:masterfrom
Achooo:ash/issue-186-fix-patch-errors

Conversation

@Achooo
Copy link
Copy Markdown
Contributor

@Achooo Achooo commented Apr 23, 2025

Fixes #186

Attempt to fix the scimErrors that are overwritten in the patch validation logic. Feel free to modify / close this PR, just a proposed fix 💯

@Achooo Achooo force-pushed the ash/issue-186-fix-patch-errors branch from 543ec92 to b679fb0 Compare April 23, 2025 01:17
Comment thread resource_type.go
}
value, err := validator.Validate()
if err != nil {
return nil, &errors.ScimErrorInvalidValue
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New logic to unwrap the underlying scim error (this does assume/require underlying errors returned are pointers as best practice to work properly, which does seem to be the case).

Please let me know if any other tests should be added as I only noticed the handlers_test.go tests. 🙏🏽

Copy link
Copy Markdown
Collaborator

@q-uint q-uint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM! Nice catch preserving the specific SCIM error instead of swallowing it.

@q-uint q-uint merged commit 74f9aa0 into elimity-com:master Mar 24, 2026
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.

Patch validation errors are swallowed (defaults to ScimErrorInvalidValue)

2 participants