mirror of
git://git.proxmox.com/git/pve-apiclient.git
synced 2025-03-11 00:58:27 +03:00
client exception: try to avoid HTTP code duplication in error string
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
9518a97873
commit
50f793b9d1
@ -99,8 +99,13 @@ sub raise_param_exc {
|
|||||||
|
|
||||||
sub stringify {
|
sub stringify {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $msg = $self->{code} ? "$self->{code} $self->{msg}" : $self->{msg};
|
my $msg = $self->{msg};
|
||||||
|
if (my $code = $self->{code}) {
|
||||||
|
if ($msg !~ /^\s*\Q$code\E[\s:,]/) { # avoid duplicating the error code heuristically
|
||||||
|
$msg = "$code $msg";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($msg !~ m/\n$/) {
|
if ($msg !~ m/\n$/) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user