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

170
Views
How to get thrown errors in service task implemented with JavaScript SDK in my code?

I have a process definition which whenever my web app client sends a specific request to my server, I start an instance of it. In this process, I have a service task that I have implemented it using javascript SDK. In this service task under some conditions, I throw a BPMN error like this:

export const checkTimePeriod = () => {
 client.subscribe("checkTimePeriod", async function ({ task, taskService }) {
  const requestTime = task.variables.get("requestTime");

  if (requestTime < 20) {
     // complete the task
     await taskService.complete(task);
  } else {
    const errorMessage = "Not in allowed time period";
    await taskService.handleBpmnError(task, errorMessage);
  }
});
};

Now since this is a callback and runs whenever my process reaches this state, how can I get this error in my own code in the upper function? Thanks.

about 4 years ago · Juan Pablo Isaza
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!