I'm integrating PepAgent into pephub and if I try to access a project that doesn't exist (e.g. demo/basiccc) then it throws a TypeError:
line 114, in get_project
_LOGGER.info(f"Project has been found: {found_prj[0]}")
TypeError: 'NoneType' object is not subscriptable
Would be nice to have a simple catch and throw an error maybe? Or throw warning and just return the None
if found_prj is not None:
_LOGGER.info(f"Project has been found: {found_prj[0]}")
project_value = found_prj[1]
new_project = peppy.Project()
new_project.from_dict(project_value)
return new_project
else:
_LOGGER.warn(f"No project named '{project_name}' found in database.")
return None
# or throw exception?
# raise pepagent.PEPNotFoundException(f"PEP with name '{project_name}' not found in database")
This helps me catch errors too on the PEPhub side of things so I can return 404's. Instead of looking for TypeErrors
I'm integrating
PepAgent
intopephub
and if I try to access a project that doesn't exist (e.g.demo/basiccc
) then it throws aTypeError
:Would be nice to have a simple catch and throw an error maybe? Or throw warning and just return the
None
This helps me catch errors too on the PEPhub side of things so I can return
404
's. Instead of looking forTypeError
s