MacOS.MacOSError object
The MacOS.MacOSError object is thrown as an exception when MacOS error
occures or an AppleEvent fails.
| Method/Property |
Description |
| MacOS.MacOSError.toString() |
returns the error's message string
|
| message |
read-only
the error's message string
|
| error |
read-only
the error's number |
| offendingObject |
read-only
the offending object indicated in the AppleEvent's reply |
| partialResult |
read-only
the partial result indicated in the AppleEvent's reply |
| expectedType |
read-only
the expected type indicating in the AppleEvent's reply |
Here is an example of how this object is used in combination with JavaScript's
exception handling facilities:
|
Sample
|
try {
MacOS.appSelf().display_dialog("Press
Cancel!").button_returned;
}
catch (e) {
if (e.error == -128 /* userCanceledErr
*/)
"Cancel";
else
throw e;
} |
|
|