Skip to content
Snippets Groups Projects
Commit 7f952b04 authored by Emanuele Laface's avatar Emanuele Laface
Browse files

Add exception handler if Channel Finder Server is not available

parent 0b46ec9b
No related branches found
No related tags found
No related merge requests found
Pipeline #30117 passed
......@@ -59,14 +59,17 @@ class myHandler(BaseHTTPRequestHandler):
search_string=search_string[:-1]
search_string+=','
search_string=search_string[:-1]
result = cf.find(name=search_string)
try:
result = cf.find(name=search_string)
if len(result)==0:
returnlist='No PV found.'
else:
for pv in result:
returnlist+='<a href="#" onclick="searchPV(\''+pv['name']+'\')">'+pv['name']+'</a>'
returnlist+='<br>'
except:
returnlist='Channel Finder Server Not Available.'
if len(result)==0:
returnlist='No PV found.'
else:
for pv in result:
returnlist+='<a href="#" onclick="searchPV(\''+pv['name']+'\')">'+pv['name']+'</a>'
returnlist+='<br>'
self.wfile.write(bytes(json.dumps({'pvs':returnlist}), "utf-8"))
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment