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

TtextYash4/1/2024
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.
Ppiechart4/3/2024
I think it will be the error thrown by the underlying client. So it depends on the client you are using
TtextYash4/9/2024
oh okay, then I should be going through the postgress library SOLVED

Looking for more? Join the community!