plaid / plaid-node

Node bindings for Plaid

Home Page:https://plaid.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is the error handling code in the README correct ?

Ranhiru opened this issue · comments

Is this still valid ?

https://github.com/plaid/plaid-node#error-handling

try {
  await plaidClient.transactionsSync(request);
} catch (error) {
  const err = error.response.data;
}

That part of the README has not been updated for 2 years and it seems like that part is not up to date anymore. Can someone from Plaid chime in please ?

Thank you

Hi @Ranhiru -- yes, this is still the recommended error handling format. We have tests here that show how this works more in depth.

Are you receiving something unexpected?

@cgfarmer4 Thanks you. Are there type definitions for error ? Is it PlaidError ? Or is error.response.data is of type PlaidError ?

Error and response are Axios types but you are correct, error.response.data is of type PlaidError.

Thank you :)