From 4412d8c5df278f3542e2684253178f281b167ee0 Mon Sep 17 00:00:00 2001 From: Alex Yong Date: Fri, 16 Mar 2018 13:10:36 +0000 Subject: [PATCH] ISSUE=2971 PROJ=159 reverting changes. --- lib/GRNOC/WebService/Method.pm | 42 ---------------------------------- 1 file changed, 42 deletions(-) diff --git a/lib/GRNOC/WebService/Method.pm b/lib/GRNOC/WebService/Method.pm index 51d3dad..8b8823b 100644 --- a/lib/GRNOC/WebService/Method.pm +++ b/lib/GRNOC/WebService/Method.pm @@ -78,10 +78,6 @@ Callbacks are passed a reference to the method object and a reference to an inpu When an error occurs, the callback should use the Method->set_error() method to document the error condition and then return undefined. -If conditions occur in which setting an error is too much, but an issue needs to be reported to the user, -the callback should use the Method->set_warning() method to document the warning condition. However, as long -as an error does not appear, the callback should still return results (if any) - The second argument to a callback is reference to the untainted parameter hash, if the input parameter is named "number" then $params->{'number'}{'value'} will provide the value for that parameter. @@ -472,44 +468,6 @@ sub help { return \%help; } -=head2 get_warning() -gets the warnings encountered or undef. -=cut - -sub get_warning { - my $self = shift; - return $self->{'warning'}; -} - - -=head2 set_warning - -taking a warning string as an argument, this goes -and either sets the warning if it's undefined, -or - -=cut - -sub set_warning { - my $self = shift; - my $warning = shift; - - return if !$warning; - - if (!$self->{'warning'}) { - $self->{'warning'} = []; - } - - if (ref($warning) eq 'ARRAY') { - push(@{$self->{'warning'}}, @$warning); - } - else { - push (@{$self->{'warning'}}, $warning); - } - - return join('\n', @{$self->{'warning'}}); -} - =head2 get_error() gets the last error encountered or undef.