Open Shayndee opened 5 months ago
I'm not deep on the Python version of the library, but from what I understand this may be by design... What's your expected behaviour for missing blocks referenced in the response, @Shayndee?
e.g.
Following up on this after diving a bit deeper:
TDocument
provides two alternative methods depending on your desired error handling behaviour:
None
when no such block exists (and we explicitly test that functionality)ValueError
when no such block existsFrom your original description, I understand the issue is that TRP throwing an error when trying to initially load/parse a JSON that references (i.e. somewhere in a block's Relationships
) a block ID that does not exist?
I understand (unless @Belval wants to correct me) that this behaviour of throwing an error on loading a document with missing block(s) is by design and ability to nicely handle malformed JSON would be a feature request.
find_block_by_id
itself throwing an error, please let us know!
if there is no block returned from self.find_block_by_id, it raises ValueError no block for id and then fails to parse the rest of the page.