File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 222222 try {
223223 this . _state = 'done' ;
224224 if ( this . _type === 'http' ) {
225- var request = new ActiveXObject ( JSONWrapper . HTTP ) ;
226- request . open ( this . _http . method , this . _http . url , false ) ;
227- this . _http . headers . forEach ( function ( header ) {
228- request . setRequestHeader ( header [ 0 ] , header [ 1 ] ) ;
229- } ) ;
230- request . send ( this . _http . data ) ;
225+ try {
226+ var request = new ActiveXObject ( JSONWrapper . HTTP ) ;
227+ request . open ( this . _http . method , this . _http . url , false ) ;
228+ this . _http . headers . forEach ( function ( header ) {
229+ request . setRequestHeader ( header [ 0 ] , header [ 1 ] ) ;
230+ } ) ;
231+ request . send ( this . _http . data ) ;
232+ } catch ( e ) {
233+ e . message = "HTTP: " + e . message ;
234+ throw e ;
235+ }
231236 this . _http . response = request ;
232237 if ( ! this . _parse ) {
233238 return this ;
Original file line number Diff line number Diff line change @@ -14,6 +14,19 @@ alias JSONUrlGet {
1414}
1515#SReject/JSONForMirc/CompatMode end
1616
17+ ;; On load, check to make sure mIRC/AdiIRC is of an applicable version
18+ on *:LOAD: {
19+ if ($~adiircexe ) {
20+ if ($version < 2.6 ) {
21+ echo -a [JSON For mIRC] AdiIRC v2.6 or later is required
22+ }
23+ }
24+ elseif ($version < 7.44 ) {
25+ echo -a [JSON For mIRC] mIRC v7.44 or later is required
26+ . unload -rs $qt ($script )
27+ }
28+ }
29+
1730
1831;; Cleanup debugging when the debug window closes
1932on *:CLOSE:@SReject/JSONForMirc/Log: {
Original file line number Diff line number Diff line change 22
33;; /JSONTest
44alias JSONTest {
5- var %x = 1 , %fail , %debug = $JSONDebug
5+ var %x = 1 , %fail
66 JSONShutDown
7- if (%debug ) {
8- JSONDebug on
9- window -n @SReject/JSONForMirc/log
10- }
7+ JSONDebug on
118 while ($isalias (jfm_test $+ %x )) {
129 tokenize 32 $jfm_test [ $+ [ %x ] ]
1310 if (! $1 ) {
You can’t perform that action at this time.
0 commit comments