Skip to content

Commit

Permalink
chore: error info use tagged template
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaominRuan authored and nikku committed Apr 29, 2024
1 parent 829989e commit 6c3cbe0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/features/modeling/cmd/SetColorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function SetColorHandler(commandStack) {
}
}

throw new Error('invalid color value: ' + color);
throw new Error(`invalid color value: ${ color }`);
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/features/modeling/cmd/SplitLaneHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SplitLaneHandler.prototype.preExecute = function(context) {
existingLanesCount = childLanes.length;

if (existingLanesCount > newLanesCount) {
throw new Error(`more than <${newLanesCount}> child lanes`);
throw new Error(`more than <${ newLanesCount }> child lanes`);
}

var isHorizontalLane = isHorizontal(shape);
Expand Down
4 changes: 2 additions & 2 deletions lib/features/ordering/BpmnOrderingProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function BpmnOrderingProvider(eventBus, canvas) {
}

if (!order) {
throw new Error('no order for <' + element.id + '>');
throw new Error(`no order for <${ element.id }>`);
}

return order;
Expand All @@ -133,7 +133,7 @@ export default function BpmnOrderingProvider(eventBus, canvas) {
}

if (!actualParent) {
throw new Error('no parent for <' + element.id + '> in <' + (newParent && newParent.id) + '>');
throw new Error(`no parent for <${ element.id }> in <${ newParent && newParent.id }>`);
}

return actualParent;
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function processTemplate(str, args) {
var replacement = args[n];

if (!replacement) {
throw new Error('unknown template {{ ' + n + '}}');
throw new Error(`unknown template {{ ${ n } }}`);
}

return replacement;
Expand Down
2 changes: 1 addition & 1 deletion test/spec/features/ordering/Helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function expectZOrder() {

if (next && compareZOrder(e, next) !== -1) {
throw new Error(
'expected <element#' + (next.id || next) + '> to be in front of <element#' + (e.id || e) + '>'
`expected <element#${ next.id || next }> to be in front of <element#${ e.id || e }>`
);
}
});
Expand Down

0 comments on commit 6c3cbe0

Please sign in to comment.