Custom With Rollback or Custom Without Rollback for error handling parts
Hi Forum, I have a question about Mendix's error handling components. In which case should you justify the one error handling over the other? For example, in the system we are building, if the result of the REST call is "error", an error message will be displayed. Error handling parts are used with the intention of outputting. In this case, what is an "error"? What do you judge it by? Is it the content of the HTTP response a header or body? Also, can that information be referenced in the subsequent Microflow of error handling? Many thanks again :)
It largely depends on what you want to do with the data up to the point of the error. If you do a rollback all changes to entities etc are reverted back to the last savepoint. Otherwise without the rollback the changed objects end up in the database. When doing REST calls you can use and change the HTTP response. You can retrieve the HTTP response and modify it for giving a more detailed error message. See also the documentation here: https://docs.mendix.com/refguide8/http-request-and-response-entities#1-introduction
Thank you again for answering my question I will let you know if I can provide more information on this.