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
piechart9mo ago
I think it will be the error thrown by the underlying client. So it depends on the client you are using
textYash
textYashOP9mo ago
oh okay, then I should be going through the postgress library SOLVED
Want results from more Discord servers?
Add your server