Error.argumentNull Function

Creates an Error object that represents the Sys.ArgumentNullException exception.

var err = Error.argumentNull(paramName, message);

Arguments

  • paramName
    (Optional) The name of the parameter as a string that caused the exception. If paramName is null, a default message is used.

  • message
    (Optional) An error message string. The value can be null.

Return Value

An Error object that has name and paramName fields added to the Error type definition.

Remarks

The argumentNull function lets you communicate that an exception has occurred when a function or method was invoked and when an argument has an invalid value of null. The message parameter lets you specify an error message. The paramName lets you specify the name of the parameter whose value was null.

Example

The following example shows how to create, throw, and catch a Sys.ArgumentNullException error by using the argumentNull function.

See Also

Concepts

Debugging and Tracing AJAX Applications Overview

Reference

Error Type Extensions

Other Resources

Language Reference