Skip to content

Catch http errors? #16

@nahuel-soldevilla

Description

@nahuel-soldevilla

(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);
  });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions