Error.invalidOperation Function

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

var err = Error.invalidOperation(message);


  • message
    (Optional) An error message string. The value can be null. If message is null, a default message is used.

Return Value

An Error object that has a name field added to the Error type definition.


The invalidOperation function lets you communicate that a method call failed for reasons other than invalid arguments. Use the invalidOperation function to create an Error object that represents a Sys.InvalidOperationException exception that can include a custom error message.

See Also


Debugging and Tracing AJAX Applications Overview


Error Type Extensions

Other Resources

Language Reference