For T241126: Step 1: Improved generic error screen (impact: high), where the user gets the option to create a Phabricator task with pre-filled text, we need to serialize Error objects we encounter; because they can’t be serialized directly with JSON.stringify(), we currently have some custom code to turn those objects into serializable values (see Gerrit discussion). We want to investigate using a library for this, such as serialize-error.
(We should probably also have tests for this, if we don’t have them already.)