apps-script-utils 2.1.1 Help

IllegalArgumentException

class IllegalArgumentException extends RuntimeException

An argument was of the wrong kind or outside the range the function accepts. This is what most requireX guards throw.

Thrown by requireArray, requireInteger, requireNonEmpty.

Every class in this hierarchy takes an optional message, another exception whose message it reuses, or nothing at all. isException recognises all of them; a plain Error is not one.

Examples

Throwing and catching

throw new IllegalArgumentException("something specific about this call"); try { doWork(); } catch (error) { if (error instanceof IllegalArgumentException) { // handled } }

See also

Source

src/exception/IllegalArgumentException.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.