File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 10
10
use FindBin;
11
11
use Getopt::Long;
12
12
use Git::Repository;
13
+ use Try::Tiny;
13
14
14
15
use lib " $FindBin::Bin /../lib" ;
15
16
use WWW::Bugzilla;
@@ -23,13 +24,24 @@ sub update_bugzilla {
23
24
my $info = shift ;
24
25
my $set = shift ;
25
26
26
- my $bz = WWW::Bugzilla-> new(
27
- server => $cfg -> {bugzilla }{server },
28
- email => $cfg -> {bugzilla }{user },
29
- password => $cfg -> {bugzilla }{pass },
30
- use_ssl => 1,
31
- bug_number => $set -> {bug }
32
- ) || croak " Cannot open bz - $! " ;
27
+ my $bz ;
28
+ my $fail ;
29
+ try {
30
+ $bz = WWW::Bugzilla-> new(
31
+ server => $cfg -> {bugzilla }{server },
32
+ email => $cfg -> {bugzilla }{user },
33
+ password => $cfg -> {bugzilla }{pass },
34
+ use_ssl => 1,
35
+ bug_number => $set -> {bug }
36
+ );
37
+ } catch {
38
+ if (/ Bug #\d + does not exist/ ) {
39
+ warn sprintf (" Bug #%s does not exist\n " , $set -> {bug });
40
+ }
41
+ $fail = 1;
42
+ };
43
+ return if ($fail );
44
+ croak " Cannot open bz - $! " unless ($bz );
33
45
34
46
my $header =
35
47
sprintf ( " Git commit: %s /commitdiff/%s \n " , $cfg -> {gitweb }, $info -> {rev } );
You can’t perform that action at this time.
0 commit comments