Mac::Safari::JavaScript::Exception - exception class to represent JS errors
use Mac::Safari::JavaScript qw(safari_js); eval { safari_js "compile time error!"; }; if ($@) { say "'$@' at line ".$@->line; }
Error class for errors originating from Mac::Safari::JavaScript.
Creates a new instance of the object. Expects the read only attributes (described below) as parameters. You shouldn't have to ever call this - these objects should be constructed by Mac::Safari::JavaScript
The following read only accessors are avalible
The original error object.
The type of the error. This can be one of the following:
The name CustomError will be used for any error thrown with the throw keyword by you in your code. Other error codes are assigned by Safari based on the type of exception that occurs.
CustomError
throw
The string describing the error as set by the browser. This value will not be set if you simply throw a string (the string will be contained in the error accessor)
error
The line number the error occured on.
This is only set for browser raised errors or if you throw an exception object. Throwing a string will not
This value is not avalble on modern Safari (since Version 5.1.3 (7534.53.10)). This will only be set if you manually throw an exception object (and only an object, not a string.)
The index of the first character of your source code that threw the exception object.
The index of the last character of your source code that threw the exception object.
The unique identifier for the originating source of the error.
(The odd case for this accessor matches the odd case that Safari itself uses)
The stringiftication of this error.
This method is automatically called if you use this object in a string context.
Written by Mark Fowler <mark@twoshortplanks.com>
Copryright Mark Fowler 2011. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Bugs should be reported to me via the CPAN RT system. http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mac::Safari::JavaScript
Mac::Safari::JavaScript
To install Mac::Safari::JavaScript, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mac::Safari::JavaScript
CPAN shell
perl -MCPAN -e shell install Mac::Safari::JavaScript
For more information on module installation, please visit the detailed CPAN module installation guide.