This might not be the correct forum, possibly a JavaSctipt help desk would be better, but here goes.
I’m a try, catch, throw style coder who used the four layer approach to implementation.
With Promise code I hsve not found a way to prepend the calling function information to the error message that is generated at the far end of the function nest. instead of a nice trace back to debug I get a message statiing “Your code is broken, good luck!”.
Is there a way to modify the error message as it comes up the call stack?
Thank you.
Hi Robert,
Unless this question is within the context of WixCode, I suppose it does belong in a general Javascript forum.
However, have you tried the stack property of error?
console.log("error: " + e.error.toString());
console.log(e.error.stack);
Umm, the output can be bit overwhelming, but it does show what happened - that is, if you can slog your way through the stack.
Does this help? I suspect that this isn’t exactly what you were looking for.
If you find out something interesting, please let me know.
Have fun,
Yisrael
I truly thank you for your reply, Yisrael. I’ve hired a Wix expert and will report what I found. I’m guessing that I will have to write each of my steps as a Promise function (this may be the wrong description) and use the reject() to manage the error string. We shall see.
Again, many thanks.
Hey Robert,
Glad to hear you hired an expert, but stay involved. WixCode is fun and easy and it’s well worth the time and effort to learn as much as you can. Before you know it you’ll be a Wix expert as well.
Happy new year,
Yisrael