Up until now, our
Calcs
class has handled errors with simpletrue
andfalse
flags. That’s not helpful to the user. At this point, we’re ready to begin defining and testing custom errors in our functions.
QUnit allows a throws
method which can check for errors in your application. This tutorial post adds some error checking to a simple Apps Script project.
Source: Unit Testing in GAS Part 4: Error Handling | ohhey[blog]
I’m a public school teacher writing Apps Script projects to manage documentation and to make life easier in general. You can read more on my blog, blog.ohheybrian.com or follow me on Twitter, @bennettscience.