tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
182 stars 30 forks source link

Don't raise an error if server doesn't implement the migrations endpoint #214

Closed giovannibenussi closed 1 month ago

giovannibenussi commented 1 month ago

There are some cases where the /v1/jobs endpoint doesn't exist so this API call returns a 404 and makes the client to fail. This PR handles this case without raising an error.

giovannibenussi commented 1 month ago

I added some extra debugging information in case this function throws an error. It looks like this:

image

This is useful for us because when a user reports an error we can know exactly which URL and status code they got from the server. This way we can know if the issue is localhost, http(s) or ws(s).