General X++ Development
What is the difference between `throw error()` and `checkFailed()`?
What is the difference between throw error() and checkFailed()?
1 answer
Write an answerthrow error() logs the message and throws an exception, so normal execution stops unless something catches it.
throw error('Something is wrong.');checkFailed() logs the validation message and returns false.
return checkFailed('Something is wrong.');For methods such as validateWrite() that already return a boolean, checkFailed() is usually the better fit.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer