mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-10 09:05:58 +00:00
02313e6c1b
This commit upgrades the code base to the latest diagram-js changes and adds a component called BpmnRegistry that can be used to retrieve a certain BPMN/DI element from a shape/connection id. Related to #19
24 lines
405 B
JavaScript
24 lines
405 B
JavaScript
var _ = require('lodash');
|
|
|
|
function failSafeAsync(fn) {
|
|
|
|
return function() {
|
|
|
|
var args = Array.prototype.slice.call(arguments);
|
|
|
|
var done = args[args.length - 1];
|
|
if (!done || !_.isFunction(done)) {
|
|
done = function(e) {
|
|
throw e;
|
|
};
|
|
}
|
|
|
|
try {
|
|
fn.apply(this, args);
|
|
} catch (e) {
|
|
done(e);
|
|
}
|
|
};
|
|
}
|
|
|
|
module.exports.failSafeAsync = failSafeAsync; |