Python and Ruby error-handling examples call algo twice
Closed this issue · 0 comments
peckjon commented
https://algorithmia.com/developers/clients/python/ the following error-handling example:
algo = client.algo('nlp/Summarizer/0.1.3')
# Pass in input required by algorithm
try:
# Get the summary result of your file's contents.
response = algo.pipe(input).result
print(response)
except:
# Algorithm error if the input is not correctly formatted.
print(algo.pipe(input).error.message)
This causes the Algo to be called a second time in the error flow. Refine.
Same for Ruby.