mirror of
git://git.proxmox.com/git/pve-apiclient.git
synced 2024-12-21 13:34:10 +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 {
|
||||
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$/) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user