- job_id = JobUtil.create_job('NF', 'TERMINATE', instanceid)
- JobUtil.add_job_status(job_id, 0, "TERM_VNF_READY")
- TermVnf(request.data, instanceid, job_id).start()
+ try:
+ job_id = JobUtil.create_job('NF', 'TERMINATE', instanceid)
+ JobUtil.add_job_status(job_id, 0, "TERM_VNF_READY")
+ TermVnf(request.data, instanceid, job_id).start()
+ except NFLCMException as e:
+ logger.error(e.message)
+ return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+ except Exception:
+ logger.error(traceback.format_exc())
+ return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)