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.
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.