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

hyperledger / identus-edge-agent-sdk-ts / 10899571717

17 Sep 2024 08:42AM UTC coverage: 74.24% (-0.3%) from 74.513%
10899571717

push

github

web-flow
feat: integrating error reporting protocol  (#289)

Signed-off-by: Francisco Javier Ribo Labrador <elribonazo@gmail.com>

1508 of 2244 branches covered (67.2%)

Branch coverage included in aggregate %.

7 of 22 new or added lines in 4 files covered. (31.82%)

1 existing line in 1 file now uncovered.

3325 of 4266 relevant lines covered (77.94%)

27.86 hits per line

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

0.0
/src/edge-agent/protocols/other/ProblemReport.ts
1
import { AgentError, DID, Message } from "../../../domain/models";
2
import { parseProblemReportBody } from "../../helpers/ProtocolHelpers";
3
import { ProtocolType } from "../ProtocolTypes";
4
import { ProblemReportBody } from "../types";
5

6

7

8

9

10
export class ProblemReport {
NEW
11
    public static type = ProtocolType.ProblemReporting;
×
12

13
    constructor(
NEW
14
        public body: ProblemReportBody,
×
NEW
15
        public from: DID,
×
NEW
16
        public to: DID,
×
NEW
17
        public thid?: string,
×
18
    ) { }
19

20
    makeMessage(): Message {
NEW
21
        const body = JSON.stringify(this.body);
×
NEW
22
        return new Message(
×
23
            body,
24
            undefined,
25
            ProblemReport.type,
26
            this.from,
27
            this.to,
28
            [],
29
            this.thid
30
        );
31
    }
32

33
    static fromMessage(fromMessage: Message): ProblemReport {
NEW
34
        if (
×
35
            fromMessage.piuri !== ProtocolType.DidcommBasicMessage ||
×
36
            !fromMessage.from ||
37
            !fromMessage.to
38
        ) {
NEW
39
            throw new AgentError.InvalidBasicMessageBodyError(
×
40
                "Invalid BasicMessage body error."
41
            );
42
        }
NEW
43
        const problemReportBody = parseProblemReportBody(fromMessage);
×
NEW
44
        return new ProblemReport(
×
45
            problemReportBody,
46
            fromMessage.from,
47
            fromMessage.to
48
        );
49
    }
50
}
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