@@ -240,6 +240,8 @@ namespace eval ::jira {
240
240
# parray result
241
241
return 1
242
242
} else {
243
+ # pass the json response in the result array to improve error handling
244
+ array set result [array get json]
243
245
return 0
244
246
}
245
247
@@ -289,6 +291,8 @@ namespace eval ::jira {
289
291
array set result [::yajl::json2dict $json(data) ]
290
292
return 1
291
293
} else {
294
+ # pass the json response in the result array to improve error handling
295
+ array set result [array get json]
292
296
return 0
293
297
}
294
298
}
@@ -348,6 +352,8 @@ namespace eval ::jira {
348
352
array set result [::yajl::json2dict $json(data) ]
349
353
return 1
350
354
} else {
355
+ # pass the json response in the result array to improve error handling
356
+ array set result [array get json]
351
357
return 0
352
358
}
353
359
}
@@ -401,6 +407,8 @@ namespace eval ::jira {
401
407
array set result [::yajl::json2dict $json(data) ]
402
408
return 1
403
409
} else {
410
+ # pass the json response in the result array to improve error handling
411
+ array set result [array get json]
404
412
return 0
405
413
}
406
414
}
@@ -442,6 +450,8 @@ namespace eval ::jira {
442
450
array set result [::yajl::json2dict $json(data) ]
443
451
return 1
444
452
} else {
453
+ # pass the json response in the result array to improve error handling
454
+ array set result [array get json]
445
455
return 0
446
456
}
447
457
}
@@ -483,9 +493,10 @@ namespace eval ::jira {
483
493
484
494
if {[::jira::raw $url POST json -body $jsonpost ]} {
485
495
array set result [::yajl::json2dict $json(data) ]
486
- # parray result
487
496
return 1
488
497
} else {
498
+ # pass the json response in the result array to improve error handling
499
+ array set result [array get json]
489
500
return 0
490
501
}
491
502
} else {
@@ -505,6 +516,8 @@ namespace eval ::jira {
505
516
array set result [::yajl::json2dict $json(data) ]
506
517
return 1
507
518
} else {
519
+ # pass the json response in the result array to improve error handling
520
+ array set result [array get json]
508
521
return 0
509
522
}
510
523
}
@@ -542,6 +555,7 @@ namespace eval ::jira {
542
555
return 1
543
556
}
544
557
} else {
558
+ array set result [array get json]
545
559
return 0
546
560
}
547
561
}
@@ -565,9 +579,10 @@ namespace eval ::jira {
565
579
566
580
if {[::jira::raw $url GET json]} {
567
581
array set result [::yajl::json2dict $json(data) ]
568
- # parray result
569
582
return 1
570
583
} else {
584
+ # pass the json response in the result array to improve error handling
585
+ array set result [array get json]
571
586
return 0
572
587
}
573
588
}
@@ -593,7 +608,6 @@ namespace eval ::jira {
593
608
unset -nocomplain project
594
609
array set project $p
595
610
if {![info exists argarray(key)] || $argarray(key) eq $project(key) } {
596
- # parray project
597
611
foreach i $project(issuetypes) {
598
612
unset -nocomplain it
599
613
array set it $i
@@ -602,9 +616,10 @@ namespace eval ::jira {
602
616
}
603
617
}
604
618
605
- # parray result
606
619
return 1
607
620
} else {
621
+ # pass the json response in the result array to improve error handling
622
+ array set result [array get json]
608
623
return 0
609
624
}
610
625
@@ -622,8 +637,6 @@ namespace eval ::jira {
622
637
foreach el [::yajl::json2dict $json(data) ] {
623
638
unset -nocomplain item
624
639
array set item $el
625
- # parray item
626
- # puts "-- "
627
640
if {[string tolower $name ] eq [string tolower $item($field) ]} {
628
641
return $item(id)
629
642
}
@@ -645,9 +658,10 @@ namespace eval ::jira {
645
658
646
659
if {[::jira::raw $url GET json]} {
647
660
array set result [::yajl::json2dict $json(data) ]
648
- # parray result
649
661
return 1
650
662
} else {
663
+ # pass the json response in the result array to improve error handling
664
+ array set result [array get json]
651
665
return 0
652
666
}
653
667
}
@@ -666,9 +680,10 @@ namespace eval ::jira {
666
680
667
681
if {[::jira::raw $url GET json]} {
668
682
array set result [::yajl::json2dict $json(data) ]
669
- # parray result
670
683
return 1
671
684
} else {
685
+ # pass the json response in the result array to improve error handling
686
+ array set result [array get json]
672
687
return 0
673
688
}
674
689
}
@@ -682,9 +697,11 @@ namespace eval ::jira {
682
697
683
698
set url " [ ::jira::baseurl] /rest/api/2/project/${projectID} /versions"
684
699
if {[::jira::raw $url GET json]} {
685
- set result [::yajl::json2dict $json(data) ]
700
+ array set result [::yajl::json2dict $json(data) ]
686
701
return 1
687
702
} else {
703
+ # pass the json response in the result array to improve error handling
704
+ array set result [array get json]
688
705
return 0
689
706
}
690
707
@@ -723,9 +740,10 @@ namespace eval ::jira {
723
740
724
741
if {[::jira::raw $url PUT json -body $jsonpost ]} {
725
742
array set result [::yajl::json2dict $json(data) ]
726
- # parray result
727
743
return 1
728
744
} else {
745
+ # pass the json response in the result array to improve error handling
746
+ array set result [array get json]
729
747
return 0
730
748
}
731
749
}
0 commit comments