Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch http errors? #16

Open
nahuel-soldevilla opened this issue Apr 7, 2021 · 1 comment
Open

Catch http errors? #16

nahuel-soldevilla opened this issue Apr 7, 2021 · 1 comment

Comments

@nahuel-soldevilla
Copy link
Member

(Logging some features discussed during the hackaton, which are not currently available at least to my knowledge)

a catch() api, similar to Promise.catch().
Right now there doesn't seem to be way to know if there was an error, unless some workaround using timeouts?

export function brapiAll(brapi: any, timeout = 5000): Promise<any> {
  return new Promise((resolve, reject) => {
    brapi.all((res: any) => resolve(res));
    setTimeout(reject, timeout);
  });
}
@sebastian-raubach
Copy link

+1 Error handling is pretty essential

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants