You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the EJSON payload converter to serialize all my payload (including error details) without risking my workers crashing.
Why? I'm using ApplicationError's details to marshal exceptions from activity to workflow. Sometimes due to our own bugs and inattentiveness, we'd try to pass arbitrary objects (non necessarily JSONfiable) as the "details".
Describe the bug
I've used the EJSON payload converter almost verbatim in my code. The converter throws an error when the payload cannot be converted (due to unknown type, cyclic JSON etc.):
thrownewUnsupportedEjsonTypeError(`Can't run EJSON.stringify on this value: ${value}. Either convert it (or its properties) to EJSON-serializable values (see https://docs.meteor.com/api/ejson.html ), or create a custom data converter. EJSON.stringify error message: ${errorMessage(e,)}`,easError,);
If this occurs when converting an activity's response, no harm done since this will be caught by the try-catch that's responsible for catching all of the activity's errors.
However, if this happens when encoding e.g. the details of an ApplicationError, this error will escape the Worker.run and effectively crash the worker.
What are you really trying to do?
Use the EJSON payload converter to serialize all my payload (including error details) without risking my workers crashing.
Why? I'm using
ApplicationError
'sdetails
to marshal exceptions from activity to workflow. Sometimes due to our own bugs and inattentiveness, we'd try to pass arbitrary objects (non necessarily JSONfiable) as the "details".Describe the bug
I've used the EJSON payload converter almost verbatim in my code. The converter throws an error when the payload cannot be converted (due to unknown type, cyclic JSON etc.):
If this occurs when converting an activity's response, no harm done since this will be caught by the try-catch that's responsible for catching all of the activity's errors.
However, if this happens when encoding e.g. the
details
of anApplicationError
, this error will escape theWorker.run
and effectively crash the worker.Minimal Reproduction
From your activity:
Environment/Versions
Version 1.9.3
The text was updated successfully, but these errors were encountered: