| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Yars::Util; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 24 |  |  | 24 |  | 841913 | use strict; | 
|  | 24 |  |  |  |  | 58 |  | 
|  | 24 |  |  |  |  | 737 |  | 
| 4 | 24 |  |  | 24 |  | 119 | use warnings; | 
|  | 24 |  |  |  |  | 62 |  | 
|  | 24 |  |  |  |  | 522 |  | 
| 5 | 24 |  |  | 24 |  | 418 | use 5.010; | 
|  | 24 |  |  |  |  | 93 |  | 
| 6 | 24 |  |  | 24 |  | 280 | use base qw( Exporter ); | 
|  | 24 |  |  |  |  | 52 |  | 
|  | 24 |  |  |  |  | 4031 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | # ABSTRACT: Yars internally used functions. | 
| 9 |  |  |  |  |  |  | our $VERSION = '1.28'; # VERSION | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | our @EXPORT_OK = qw( format_tx_error ); | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | sub format_tx_error | 
| 15 |  |  |  |  |  |  | { | 
| 16 | 44 |  |  | 44 | 1 | 737 | my($error) = @_; | 
| 17 | 44 | 50 |  |  |  | 226 | 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 |  |  |  |  | 290 | $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.28 | 
| 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 |