Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

489
Views
Non-Error promise rejection captured with value: undefined
const validatePnr = async (pnr: string) => {
    return new Promise<void>(async (resolve, reject) => {
      try {
        setIsLoading(true);
        const url = `/api/v2/pnr/validate?stationCode=${stationCode}&outletId=${outletId}&vendorId=${vendorId}&pnr=${pnr}${
          !!currentStationInfo?.arrival ? `&eta=${currentStationInfo.arrival}` : ""
        }`;
        const data = (await CaptchaGet({ url, disableErrorToast: true })) as ApiResponse<ValidatePnrInfo>;
        if (data.status === "failure") {
          invalidPnrCb(data.message, data.result);
          reject();
        } else if (data.result.status && data.result.statusCode === 200) {
          const pnrResponse: PnrResponse = { status: data.status, result: data.result.data, message: data.message };
          validPnrCb(pnrResponse, pnr);
          resolve();
        } else {
          invalidPnrCb(data.result.statusMsg, data.result);
          reject();
        }
        setData(data.result);
      } catch (err) {
        setIsLoading(false);
        invalidPnrCb("Something went wrong. Please try again.");
        reject();
      }
    });
  };

Getting Non-Error promise rejection captured with value: undefined in JavaScript promise handling sentry, I am handling rejection properly but need your suggestion where should I change in code?

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!