line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Yars::Util; |
2
|
|
|
|
|
|
|
|
3
|
24
|
|
|
24
|
|
925715
|
use strict; |
|
24
|
|
|
|
|
54
|
|
|
24
|
|
|
|
|
695
|
|
4
|
24
|
|
|
24
|
|
124
|
use warnings; |
|
24
|
|
|
|
|
72
|
|
|
24
|
|
|
|
|
565
|
|
5
|
24
|
|
|
24
|
|
678
|
use 5.010; |
|
24
|
|
|
|
|
72
|
|
6
|
24
|
|
|
24
|
|
130
|
use base qw( Exporter ); |
|
24
|
|
|
|
|
59
|
|
|
24
|
|
|
|
|
4286
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Yars internally used functions. |
9
|
|
|
|
|
|
|
our $VERSION = '1.31'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw( format_tx_error ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub format_tx_error |
15
|
|
|
|
|
|
|
{ |
16
|
44
|
|
|
44
|
1
|
674
|
my($error) = @_; |
17
|
44
|
50
|
|
|
|
265
|
if($error->{advice}) |
|
|
50
|
|
|
|
|
|
18
|
|
|
|
|
|
|
{ |
19
|
0
|
|
|
|
|
0
|
return sprintf("[%s] %s", $error->{advice}, $error->{message}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
elsif($error->{code}) |
22
|
|
|
|
|
|
|
{ |
23
|
0
|
|
|
|
|
0
|
return sprintf("(%s) %s", $error->{code}, $error->{message}); |
24
|
|
|
|
|
|
|
} |
25
|
44
|
|
|
|
|
307
|
$error->{message}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=encoding UTF-8 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Yars::Util - Yars internally used functions. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 VERSION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
version 1.31 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 FUNCTIONS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 format_tx_error |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
say format_tx_error($tx->error); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Formats a transaction error for human readable diagnostic. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Original author: Marty Brandon |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Current maintainer: Graham Ollis E<lt>plicease@cpan.orgE<gt> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Contributors: |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Brian Duggan |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Curt Tilmes |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This software is copyright (c) 2013 by NASA GSFC. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
69
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |