swh-graph occasionally returns empty lines
eg. when querying https://archive.softwareheritage.org/api/1/graph/leaves/swh:1:cnt:12542b4c4e101838a3480f72c841d22ed5cb18de/?direction=backward&limit=1&resolve_origins=1
this causes swh-web to crash:
https://sentry.softwareheritage.org/organizations/swh/issues/11018/?referrer=phabricator_plugin
ValidationError: ['Invalid SWHID: invalid syntax: ']
File "swh/web/api/views/graph.py", line 72, in _resolve_origin_swhids_in_graph_response
processed_line.append(_resolve_origin_swhid(swhid, origin_urls))
File "swh/web/api/views/graph.py", line 36, in _resolve_origin_swhid
parsed_swhid = ExtendedSWHID.from_string(swhid)
File "swh/model/swhids.py", line 140, in from_string
parts = _parse_swhid(s)
File "swh/model/swhids.py", line 444, in _parse_swhid
"Invalid SWHID: invalid syntax: %(swhid)s", params={"swhid": swhid}
Migrated from T4531 (view on Phabricator)
Edited by Phabricator Migration user