UnsupportedException

Summary

The exception to be thrown if the host environment does not

support a necessary feature.

Description

UnsupportedException should be thrown if the host environment does not support a required or necessary feature.

An example would be a library that depends on the DOM (Document Object Model) API of the web browser. When the library is used outside the web browser, the DOM API functions are not available. Thus, the library may choose to throw UnsupportedException.

Examples

Basic Usage
1
2
3
4
5
6
7
8
import System;
external XMLHttpRequest;
 
if (typeof XMLHttpRequest != "function") {
    throw new System.Exceptions.UnsupportedException(
        "AJAX (XMLHttpRequest) is not supported in this environment."
    );
}

Methods

Share

HTML | BBCode | Direct Link