Commit 017850b0 authored by Leigh Stoller's avatar Leigh Stoller

Add SearchFailedResponse() convenience function. Change output() method

to allow setting the output of a response.
parent c760301b
#!/usr/bin/perl -w
#
# Copyright (c) 2008-2015 University of Utah and the Flux Group.
# Copyright (c) 2008-2016 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -204,11 +204,17 @@ sub Create($$;$$)
sub field($$) { return ($_[0]->{$_[1]}); }
sub code($) { return field($_[0], "code"); }
sub value($) { return field($_[0], "value"); }
sub output($) { return field($_[0], "output"); }
# This is very optional.
sub logurl($) {
return (exists($_[0]->{"logurl"}) ? $_[0]->{"logurl"} : undef);
}
sub output($;$) {
my ($self,$string) = @_;
if (defined($string)) {
$self->{'output'} = $string;
}
return field($_[0], "output");
}
# Check for response object. Very bad, but the XML encoder does not
# allow me to intercept the encoding operation on a blessed object.
......@@ -301,5 +307,15 @@ sub BadArgsResponse(;$)
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, $msg);
}
sub SearchFailedResponse(;$)
{
my ($msg) = @_;
$msg = "Search Failure"
if (!defined($msg));
return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef, $msg);
}
# _Always_ make sure that this 1 is at the end of the file...
1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment