question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception handling

See original GitHub issue

Hello!

There is one more issue: exception.zip

What expects: that I catch exception and send it message to user. What happens:

/node_modules/bpmn-engine/lib/mapper.js:9
    throw new Error(`Unknown activity type ${type}`);
    ^

Error: Unknown activity type bpmn:SignalEventDefinition

and it exception kills whole server process.

Wrapping any part of my code by try {...} catch(e) {...} has no result, because exception produced somewhere in async code of bpmn-engine lib.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
paed01commented, Aug 28, 2017

Not in master unfortunately. Sorry about that. But I have considered it when refactoring the engine in develop.

There is a deprecated work-around if you are running on node-6* https://nodejs.org/dist/latest-v6.x/docs/api/domain.html. Not elegant but could work.

0reactions
neonxpcommented, Aug 29, 2017

Oh, it fully resolves my trouble! Thank you. For history, my resolution:

import d from 'domain';
...
const d = domain.create();
d.on('error', (er) => {
  console.log(`Engine error: ${er.message}`);
  // Do cleanup here and send error to client
});
d.run(() => {
  const engine = new Bpmn.Engine({
    name: 'Script',
    source: XML,
    moddleOptions: {camunda}
  });
  engine.execute(
    this.getOptions(),
    (err, definition) => {
      debug(
        'Bpmn definition definition started with variables',
        definition && definition.getProcesses()[0].context.variables
      );
    });
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception Handling in Java - Javatpoint
Exception Handling is a mechanism to handle runtime errors such as ClassNotFoundException, IOException, SQLException, RemoteException, etc.
Read more >
Exception handling - Wikipedia
In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions ...
Read more >
What is Exception Handling? - SearchSoftwareQuality
Exception handling is the process of responding to unwanted or unexpected events when a computer program runs. Exception handling deals with these events...
Read more >
Exceptions in Java - GeeksforGeeks
Exception Handling in Java is one of the effective means to handle the runtime errors so that the regular flow of the application...
Read more >
Exception Handling in Java - DigitalOcean
Exceptions in Java can arise from different kinds of situations such as wrong data entered by the user, hardware failure, network connection ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found