• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

paed01 / bpmn-elements / 11453352292

22 Oct 2024 04:39AM UTC coverage: 99.714% (+0.01%) from 99.704%
11453352292

push

github

paed01
running call activity tracks as wait

2840 of 2877 branches covered (98.71%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

10778 of 10780 relevant lines covered (99.98%)

8010.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.69
/src/error/Errors.js
1
import { cloneMessage } from '../messageHelper.js';
3✔
2

3✔
3
class ActivityError extends Error {
3✔
4
  constructor(description, sourceMessage, inner) {
3✔
5
    super(description);
528✔
6
    this.type = 'ActivityError';
528✔
7
    this.name = this.constructor.name;
528✔
8
    this.description = description;
528✔
9
    if (sourceMessage) this.source = cloneMessage(sourceMessage, sourceMessage.content?.error && { error: undefined });
528✔
10
    if (inner) {
528✔
11
      this.inner = inner;
426✔
12
      if (inner.name) this.name = inner.name;
426✔
13
      if (inner.code) this.code = inner.code;
426✔
14
    }
426✔
15
  }
528✔
16
}
3✔
17

3✔
18
class RunError extends ActivityError {
3✔
19
  constructor(...args) {
3✔
20
    super(...args);
69✔
21
    this.type = 'RunError';
69✔
22
  }
69✔
23
}
3✔
24

3✔
25
class BpmnError extends Error {
3✔
26
  constructor(description, behaviour, sourceMessage, inner) {
3✔
27
    super(description);
87✔
28
    this.type = 'BpmnError';
87✔
29
    this.name = behaviour?.name ?? this.constructor.name;
87✔
30
    this.description = description;
87✔
31
    this.code = behaviour?.errorCode?.toString() ?? behaviour?.code;
87✔
32
    this.id = behaviour?.id;
87✔
33
    if (sourceMessage) this.source = cloneMessage(sourceMessage, sourceMessage.content?.error && { error: undefined });
87✔
34
    if (inner) this.inner = inner;
87!
35
  }
87✔
36
}
3✔
37

3✔
38
export { ActivityError, BpmnError, RunError, makeErrorFromMessage };
3✔
39

3✔
40
function makeErrorFromMessage(errorMessage) {
222✔
41
  const { content } = errorMessage;
222✔
42

222✔
43
  if (isKnownError(content)) return content;
222✔
44

210✔
45
  const { error } = content;
210✔
46
  if (!error) return new Error(`Malformatted error message with routing key ${errorMessage.fields?.routingKey}`);
222✔
47

204✔
48
  if (isKnownError(error)) return error;
222✔
49

60✔
50
  switch (error.type) {
60✔
51
    case 'ActivityError':
222✔
52
      return new ActivityError(
36✔
53
        error.message || error.description,
36✔
54
        error.source,
36✔
55
        error.inner ? error.inner : { code: error.code, name: error.name },
36✔
56
      );
36✔
57
    case 'RunError':
222✔
58
      return new RunError(
3✔
59
        error.message || error.description,
3✔
60
        error.source,
3✔
61
        error.inner ? error.inner : { code: error.code, name: error.name },
3!
62
      );
3✔
63
    case 'BpmnError':
222✔
64
      return new BpmnError(error.message || error.description, error, error.source);
21✔
65
  }
222✔
UNCOV
66

×
UNCOV
67
  return error;
×
68
}
222✔
69

3✔
70
function isKnownError(test) {
426✔
71
  if (test instanceof ActivityError) return test;
426✔
72
  if (test instanceof BpmnError) return test;
426✔
73
  if (test instanceof Error) return test;
426✔
74
}
426✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc