LNS Home
JavaScript OSA
JavaScript OSA Home
Download & Installation
QuickStart
Project Status
Documentation
 
Object Reference
 
Core
MacOS
MacOS.AEDesc
MacOS.AEApp
MacOS.AEClass
MacOS.AEColl
MacOS.FileSpec
MacOS.OSA
MacOS.MacOSError
Sending Raw AppleEvents
Responding to AppleEvents
AppleEvent to JavaScript Value Conversion
How-Tos
 
Open Handler
Folder Actions Handlers
Write Some Text
Calling JavaScript from REALbasic
Using JavaScript Libraries
FAQ
Mailing List
JavaScript Language Documentation & Links
Products
x Script Debugger 4.5
Site Contents
bullet Mark’s Blog
Product Registration
Bug Reporting
x Freeware
Contacting Us

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;
}

 

 

 

 

 

 

 

 

 

 

 

 


Copyright © 1998-2009 Late Night Software Ltd. - All Rights Reserved.