db0 / pythorhead

A python library for interacting with Lemmy
GNU Affero General Public License v3.0
77 stars 25 forks source link

requestor.api catches all exceptions, making it really hard to debug. #73

Closed lullis closed 1 year ago

lullis commented 1 year ago

First of all, thank you for your work on the library, it's becoming an integral part of https://github.com/mushroomlabs/fediverser. :)

I'm just wondering if it would be possible to let API exception errors be raised on the call, instead of returning None.

db0 commented 1 year ago

I can, but can I ask why not just check if it's returning None?

lullis commented 1 year ago

Because I want to know what is wrong with the request. Example: if I make a call to comment.create but I pass a language code that is not accepted by the community, I can get that information from the exception and that information is lost if every error returns None.

db0 commented 1 year ago

Done in #74

Just pass raise_exceptions=True to Lemmy()