| 1 | package Git::Raw::Error; | ||||||||||
| 2 | 87 | $Git::Raw::Error::VERSION = '0.90'; | |||||||||
| 3 | 87 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 87 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 87 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | use overload | ||||||||||
| 8 | 16 | ▶ | '""' => sub { return $_[0] -> message.' at '.$_[0] -> file.' line '.$_[0] -> line }, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 0 | ▶ | '0+' => sub { return $_[0] -> code }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 10 | 2 | ▶ | 'bool' => sub { return $_[0] -> _is_error }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 87 | 'fallback' => 1; | |||||||||
| 12 | |||||||||||
| 13 | 30 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.0
| |||||||||||
| 14 | # This AUTOLOAD is used to 'autoload' constants from the constant() | ||||||||||
| 15 | # XS function. | ||||||||||
| 16 | |||||||||||
| 17 | 30 | my $constname; | |||||||||
| 18 | 30 | our $AUTOLOAD; | |||||||||
| 19 | 30 | ($constname = $AUTOLOAD) =~ s/.*:://; | |||||||||
| 20 | 30 | ▶ | croak "&Git::Raw::Error::constant not defined" if $constname eq '_constant'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 30 | my ($error, $val) = _constant($constname); | |||||||||
| 22 | 30 | ▶ | if ($error) { croak $error; } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | { | ||||||||||
| 24 | 87 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 29 | ▶ | *$AUTOLOAD = sub { $val }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 26 | } | ||||||||||
| 27 | 29 | goto &$AUTOLOAD; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 87 | ▶ | use Git::Raw; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | |||||||||||
| 32 | =head1 NAME | ||||||||||
| 33 | |||||||||||
| 34 | Git::Raw::Error - Error class | ||||||||||
| 35 | |||||||||||
| 36 | =head1 VERSION | ||||||||||
| 37 | |||||||||||
| 38 | version 0.90 | ||||||||||
| 39 | |||||||||||
| 40 | =head1 DESCRIPTION | ||||||||||
| 41 | |||||||||||
| 42 | A L<Git::Raw::Error> represents an error. A L<Git::Raw::Error> may be the result | ||||||||||
| 43 | of a libgit2 error, or may be generated internally due to misuse of the API. | ||||||||||
| 44 | |||||||||||
| 45 | B<WARNING>: The API of this module is unstable and may change without warning | ||||||||||
| 46 | (any change will be appropriately documented in the changelog). | ||||||||||
| 47 | |||||||||||
| 48 | =head1 METHODS | ||||||||||
| 49 | |||||||||||
| 50 | =head2 message( ) | ||||||||||
| 51 | |||||||||||
| 52 | Error message. | ||||||||||
| 53 | |||||||||||
| 54 | =head2 file( ) | ||||||||||
| 55 | |||||||||||
| 56 | Caller file. | ||||||||||
| 57 | |||||||||||
| 58 | =head2 line( ) | ||||||||||
| 59 | |||||||||||
| 60 | Caller line. | ||||||||||
| 61 | |||||||||||
| 62 | =head2 code( ) | ||||||||||
| 63 | |||||||||||
| 64 | Error code. | ||||||||||
| 65 | |||||||||||
| 66 | =head2 category( ) | ||||||||||
| 67 | |||||||||||
| 68 | The category (class) or source of the error. | ||||||||||
| 69 | |||||||||||
| 70 | =head1 CONSTANTS | ||||||||||
| 71 | |||||||||||
| 72 | =head2 OK | ||||||||||
| 73 | |||||||||||
| 74 | No error. | ||||||||||
| 75 | |||||||||||
| 76 | =head2 ERROR | ||||||||||
| 77 | |||||||||||
| 78 | Generic error. | ||||||||||
| 79 | |||||||||||
| 80 | =head2 ENOTFOUND | ||||||||||
| 81 | |||||||||||
| 82 | The eequested object could not be found. | ||||||||||
| 83 | |||||||||||
| 84 | =head2 EEXISTS | ||||||||||
| 85 | |||||||||||
| 86 | The object already exists. | ||||||||||
| 87 | |||||||||||
| 88 | =head2 EAMBIGUOUS | ||||||||||
| 89 | |||||||||||
| 90 | More than one object matches. | ||||||||||
| 91 | |||||||||||
| 92 | =head2 EBUFS | ||||||||||
| 93 | |||||||||||
| 94 | Output buffer too short to hold data. | ||||||||||
| 95 | |||||||||||
| 96 | =head2 EBAREREPO | ||||||||||
| 97 | |||||||||||
| 98 | The operation is is not allowed on a bare repository. | ||||||||||
| 99 | |||||||||||
| 100 | =head2 EUNBORNBRANCH | ||||||||||
| 101 | |||||||||||
| 102 | C<HEAD> refers to a branch with no commits. | ||||||||||
| 103 | |||||||||||
| 104 | =head2 EUNMERGED | ||||||||||
| 105 | |||||||||||
| 106 | A merge is in progress. | ||||||||||
| 107 | |||||||||||
| 108 | =head2 ENONFASTFORWARD | ||||||||||
| 109 | |||||||||||
| 110 | Reference was not fast-forwardable. | ||||||||||
| 111 | |||||||||||
| 112 | =head2 EINVALIDSPEC | ||||||||||
| 113 | |||||||||||
| 114 | Name/ref spec was not in a valid format. | ||||||||||
| 115 | |||||||||||
| 116 | =head2 ECONFLICT | ||||||||||
| 117 | |||||||||||
| 118 | Checkout conflicts prevented operation. | ||||||||||
| 119 | |||||||||||
| 120 | =head2 ELOCKED | ||||||||||
| 121 | |||||||||||
| 122 | Lock file prevented operation. | ||||||||||
| 123 | |||||||||||
| 124 | =head2 EMODIFIED | ||||||||||
| 125 | |||||||||||
| 126 | Reference value does not match expected. | ||||||||||
| 127 | |||||||||||
| 128 | =head2 EAUTH | ||||||||||
| 129 | |||||||||||
| 130 | Authentication error. | ||||||||||
| 131 | |||||||||||
| 132 | =head2 ECERTIFICATE | ||||||||||
| 133 | |||||||||||
| 134 | Server certificate is invalid. | ||||||||||
| 135 | |||||||||||
| 136 | =head2 EAPPLIED | ||||||||||
| 137 | |||||||||||
| 138 | Patch/merge has already been applied. | ||||||||||
| 139 | |||||||||||
| 140 | =head2 EPEEL | ||||||||||
| 141 | |||||||||||
| 142 | The requested peel operation is not possible. | ||||||||||
| 143 | |||||||||||
| 144 | =head2 EEOF | ||||||||||
| 145 | |||||||||||
| 146 | Unepected C<EOF>. | ||||||||||
| 147 | |||||||||||
| 148 | =head2 EINVALID | ||||||||||
| 149 | |||||||||||
| 150 | Invalid operation or input. | ||||||||||
| 151 | |||||||||||
| 152 | =head2 EUNCOMMITTED | ||||||||||
| 153 | |||||||||||
| 154 | Uncommited changes in index prevented operation. | ||||||||||
| 155 | |||||||||||
| 156 | =head2 EDIRECTORY | ||||||||||
| 157 | |||||||||||
| 158 | The operation is not valid for a directory. | ||||||||||
| 159 | |||||||||||
| 160 | =head2 EMERGECONFLICT | ||||||||||
| 161 | |||||||||||
| 162 | A merge conflict exists and cannot continue. | ||||||||||
| 163 | |||||||||||
| 164 | =head2 PASSTHROUGH | ||||||||||
| 165 | |||||||||||
| 166 | Passthrough | ||||||||||
| 167 | |||||||||||
| 168 | =head1 AUTHOR | ||||||||||
| 169 | |||||||||||
| 170 | Alessandro Ghedini <alexbio@cpan.org> | ||||||||||
| 171 | |||||||||||
| 172 | Jacques Germishuys <jacquesg@cpan.org> | ||||||||||
| 173 | |||||||||||
| 174 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 175 | |||||||||||
| 176 | Copyright 2014 Alessandro Ghedini. | ||||||||||
| 177 | |||||||||||
| 178 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 179 | under the terms of either: the GNU General Public License as published | ||||||||||
| 180 | by the Free Software Foundation; or the Artistic License. | ||||||||||
| 181 | |||||||||||
| 182 | See http://dev.perl.org/licenses/ for more information. | ||||||||||
| 183 | |||||||||||
| 184 | =cut | ||||||||||
| 185 | |||||||||||
| 186 | 87 | 1; # End of Git::Raw::Error | |||||||||