Open ksharma96 opened 1 year ago
The problem seems to be when the API doesn't get a 200 response in the BlocksSupport.kt file.
`error = jsonSerializer.toError(httpResponse.body)`
while parsing the error response, it's getting a String instead of an Object:
Expected BEGIN_OBJECT but was STRING at line 1 column 1 path
Just adding on to what might help:
Encountered a response from Notion's API which had the body as shown below:
body <html> 2023-01-31T19:15:44.238+05:30 <head><title>504 Gateway Time-out</title></head> 2023-01-31T19:15:44.238+05:30 <body> 2023-01-31T19:15:44.238+05:30 <center><h1>504 Gateway Time-out</h1></center> 2023-01-31T19:15:44.238+05:30 </body> 2023-01-31T19:15:44.238+05:30 </html>
Since the body was not a json, it was failing in the Parser. Can we please add a handling of such a scenarios @seratch ?
Again, thanks a lot for your SDK, much grateful.
@ksharma96 Thanks for reporting this issue. This should be improved in future versions.
Hey @seratch , GsonSerializer is failing with the following two calls to the API in the SDK :
NotionClient.retrievePage
NotionClient.retrieveBlockChildren
Any idea why this could be? Any workarounds, something I've configured wrong?
Attaching the logs below
====================================================================================