Skip to content

Create setErrorMessage function #750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 24, 2024
Merged

Create setErrorMessage function #750

merged 5 commits into from
Jun 24, 2024

Conversation

castrodd
Copy link
Member

This PR is a fix for Exception: Cannot set property message of [object Object] which has only a getter.

In February, we merged an earlier fix for this same issue (#732).

However, @ryanbecker reported a problem with our initial approach.

Therefore, we have rolled back those changes and instead take a simpler approach. Everywhere we previously tried to write to error.message, we now catch any exceptions thrown by read-only errors. In those cases, we simply return the original error and do not attempt to modify its error message.

@castrodd castrodd requested a review from ejizba June 17, 2024 22:16
@castrodd castrodd merged commit aac8f4e into v3.x Jun 24, 2024
12 checks passed
@castrodd castrodd deleted the dacastr/setErrorMessages branch June 24, 2024 17:07
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.

2 participants