How can I handle the case when the GUI.XmlLoader.loadLayout() call fails with an HTTP 400 error? wrapping the call in try/catch doesn’t catch the error.
Thanks,
Michael
Hey @Null , as you build this great feature, any idea how we could catch it?
Hello, the loadLayout method takes an onSuccess and an onError. Unfortunately, I haven’t sent the status codes as parameters in the onError.
This is the definition : public loadLayout(xmlFile: any, rootNode: any, onSuccess: BABYLON.Nullable<() => void> = null, onError: BABYLON.Nullable<(error: string) => void> = null): void so for any error handling you can set a callback as the fourth parameter.
I have never had a case of a 400 though. We can always return the status in both callbacks @sebavan .
Yup you can add it in the callback, this won t affect backcompat in any way.
Issue is, I won’t have much time in the following days, if someone would submit a PR that would be very helpful . Otherwise I’ll be able to do it sometime next week.