Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0277.py @ 3548:13e7ef106589
plugin XEP-0277: don't wrap `DataError` in `failure.Failure` in `parseCommentUrl` as it is not catched correctly:
`failure.Failure` is subclass of `BaseException` but not of `Exception`, as a result
`except Exception` doesn't catch it correctly. This is fixed by not wrapping `DataError`
in `failure.Failure` anymore.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 04 Jun 2021 17:18:44 +0200 |
parents | 02eec2a5b5f9 |
children | 7df12ffa6620 |
comparison
equal
deleted
inserted
replaced
3547:1ac5570fa998 | 3548:13e7ef106589 |
---|---|
1003 service = jid.JID(parsed_url.path) | 1003 service = jid.JID(parsed_url.path) |
1004 parsed_queries = urllib.parse.parse_qs(parsed_url.query) | 1004 parsed_queries = urllib.parse.parse_qs(parsed_url.query) |
1005 node = parsed_queries.get("node", [""])[0] | 1005 node = parsed_queries.get("node", [""])[0] |
1006 | 1006 |
1007 if not node: | 1007 if not node: |
1008 raise failure.Failure(exceptions.DataError("Invalid comments link")) | 1008 raise exceptions.DataError("Invalid comments link") |
1009 | 1009 |
1010 return (service, node) | 1010 return (service, node) |
1011 | 1011 |
1012 ## configure ## | 1012 ## configure ## |
1013 | 1013 |