How to search the docs for the correct datatype returned by each function?

Since I'm using typescript, quite often I am welcomed by eslint errors. For eample:
try {
await db.insert(posts).values({ slug, title, content, readTime });
} catch (error) {
return fail(401, { title, content, error: error.message });
}
try {
await db.insert(posts).values({ slug, title, content, readTime });
} catch (error) {
return fail(401, { title, content, error: error.message });
}
Here, how can I specify the datatype for error? The documentation does not specify any types. The documentation only shows examples.
2 Replies
piechart
piechart4mo ago
I think it will be the error thrown by the underlying client. So it depends on the client you are using
textYash
textYash4mo ago
oh okay, then I should be going through the postgress library SOLVED