Discussing Error Handling and Output Patterns in XANO Functions

In this meeting, the State Changers discussed about handling a common pattern in coding involving a function within a function. The scenario is looking up a player in a roster and returning an error when the player does not exist. The main point was whether to use a return variable or a precondition.


They discussed coding patterns in the context of Xano, mentioning its limitations in air handling. The output method discussed involved using two types of outputs from a function, a common pattern in languages like Swift. The output object should contain two members: error and result. If everything goes smoothly, the error returns as null. The State Changers suggested that the response should include these two members in the direct return call or the function response. This return setup simplifies the process by preventing the need to utilize try-catch statements: if the error is null, the function proceeds a certain way, if not it goes another way. This was proposed as an ideal method of handling this issue. The meeting ended with the agreement to continue working on the topic the following week.


(Source: Office Hours 5/4 )

State Change Members Can View The Video Here
chris-montgomery-smgTvepind4-unsplash.jpg

View This Video Now

Join State Change Risk-Free