Recently I ran into an issue with the stop event processing code which can be found here: Stop Event Processing - Developing Backendless Server Code with node.js. When returning { short: true} for the event beforeSetRelation, I receive the following error: Uncaught (in promise) Error: PrematureResult in your event handler has incompatible type ‘java.util.HashMap’, whereas return type is ‘java.lang.Integer’.
Please let me know if this is a bug with the beforeSetRelation event handler or if I can short circuit the beforeSetRelation event in another way.
Thanks in advance
Hi @David_Hasler,
Before I respond to this topic I have to make it public. Private topics are reserved for customers with paid support. Please provide us with a code snippet where we can reproduce the problem so we can help you with this.
Regards,
Marina
Here is a snippet of the code, and good to know I will make it public next time!
Hi @David_Hasler,
We are investigating your problem. We will respond to you as soon as we have the results.
Regards,
Marina
Hi @David_Hasler,
We have investigated your case. Since the SetRelation operation returns a number in the response, you need to return any number in the response, not an object. This will stop further processing of the event.
Regards,
Marina
1 Like
Thanks @Marina.Kan! This works!