engine
engine copied to clipboard
refactor(communication): better errors
This PR aims to refactor/clean up Communications regarding debug logging and error handling in preparation for better processing of such errors during error monitoring. Errors would have proper names and messages attached to them with redacted information.
- In Communication feature setup removed
CommunicationOptions
as they are inferred all way back to class property definition - Inlined
RemoteAPIServicesMapping
type and movedConfigEnvironmentRecord
to packages/core/src/com/types.ts - Inlined logs from packages/core/src/com/logs.ts to
communication.ts
as messages make more sense near the action they describe and are not reused in multiple places - Unified communication errors in packages/core/src/com/communication-errors.ts
- In packages/core/src/com/communication.ts simplified some typing and improved naming + moved methods not dependent on the instance to helpers; switched some methods with lots of parameters to accept an object and other stylistic non-functional changes