| 1 | package Kubernetes::REST::RemoteError; | ||
| 2 | our $VERSION = '1.108'; | ||
| 3 | # ABSTRACT: Compatibility helper for deprecated v0 remote errors | ||
| 4 | use Moo; | ||
| 5 | use Types::Standard qw/Int/; | ||
| 6 | use Kubernetes::REST::Error; | ||
| 7 | extends 'Kubernetes::REST::Error'; | ||
| 8 | |||
| 9 | has '+type' => (default => sub { 'Remote' }); | ||
| 10 | has status => (is => 'ro', isa => Int, required => 1); | ||
| 11 | |||
| 12 | |||
| 13 | around header => sub { | ||
| 14 | my ($orig, $self) = @_; | ||
| 15 | my $orig_message = $self->$orig; | ||
| 16 | sprintf "%s with HTTP status %d", $orig_message, $self->status; | ||
| 17 | }; | ||
| 18 | |||
| 19 | |||
| 20 | 1; | ||
| 21 | |||
| 22 | __END__ | ||
| 23 | |||
| 24 | =pod | ||
| 25 | |||
| 26 | =encoding UTF-8 | ||
| 27 | |||
| 28 | =head1 NAME | ||
| 29 | |||
| 30 | Kubernetes::REST::RemoteError - Compatibility helper for deprecated v0 remote errors | ||
| 31 | |||
| 32 | =head1 VERSION | ||
| 33 | |||
| 34 | version 1.108 | ||
| 35 | |||
| 36 | =head1 DESCRIPTION | ||
| 37 | |||
| 38 | This error class belongs to the deprecated v0 API - the v1 API croaks instead of throwing structured exceptions. It stays around so code that still catches it keeps working. | ||
| 39 | |||
| 40 | Thrown for errors reported by the cluster itself, carrying the HTTP status alongside the message of L<Kubernetes::REST::Error>. | ||
| 41 | |||
| 42 | See L<Kubernetes::REST/"UPGRADING FROM 0.02"> for migration guide. | ||
| 43 | |||
| 44 | =head2 status | ||
| 45 | |||
| 46 | HTTP status code. | ||
| 47 | |||
| 48 | =head1 SEE ALSO | ||
| 49 | |||
| 50 | =over | ||
| 51 | |||
| 52 | =item * L<Kubernetes::REST> - Main API client | ||
| 53 | |||
| 54 | =item * L<Kubernetes::REST::Error> - The base error class | ||
| 55 | |||
| 56 | =back | ||
| 57 | |||
| 58 | =head1 SUPPORT | ||
| 59 | |||
| 60 | =head2 Issues | ||
| 61 | |||
| 62 | Please report bugs and feature requests on GitHub at | ||
| 63 | L<https://github.com/pplu/kubernetes-rest/issues>. | ||
| 64 | |||
| 65 | =head2 IRC | ||
| 66 | |||
| 67 | Join C<#kubernetes> on C<irc.perl.org> or message Getty directly. | ||
| 68 | |||
| 69 | =head1 CONTRIBUTING | ||
| 70 | |||
| 71 | Contributions are welcome! Please fork the repository and submit a pull request. | ||
| 72 | |||
| 73 | =head1 AUTHORS | ||
| 74 | |||
| 75 | =over 4 | ||
| 76 | |||
| 77 | =item * | ||
| 78 | |||
| 79 | Torsten Raudssus <getty@cpan.org> | ||
| 80 | |||
| 81 | =item * | ||
| 82 | |||
| 83 | Jose Luis Martinez Torres <jlmartin@cpan.org> | ||
| 84 | |||
| 85 | =back | ||
| 86 | |||
| 87 | =head1 COPYRIGHT AND LICENSE | ||
| 88 | |||
| 89 | This software is Copyright (c) 2019-2026 by Jose Luis Martinez Torres <jlmartin@cpan.org>. | ||
| 90 | |||
| 91 | This is free software, licensed under: | ||
| 92 | |||
| 93 | The Apache License, Version 2.0, January 2004 | ||
| 94 | |||
| 95 | =cut |