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

WolferyScripting / resclient-ts / #33

27 Aug 2025 09:08PM UTC coverage: 51.192% (+0.3%) from 50.87%
#33

push

DonovanDMC
1.1.4

230 of 292 branches covered (78.77%)

Branch coverage included in aggregate %.

1660 of 3400 relevant lines covered (48.82%)

10.5 hits per line

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

14.29
/lib/models/ResError.ts
1
import type ResClient from "./ResClient.js";
1✔
2
import { ErrorCodes } from "../Constants.js";
1✔
3
import Properties from "../util/Properties.js";
1✔
4
import type { ErrorData } from "../util/types.js";
1✔
5

1✔
6
export default class ResError extends Error {
1!
7
    code?: string;
×
8
    data?: unknown;
×
9
    method?: string;
×
10
    override name = "ResError";
×
11
    params?: unknown;
×
12
    rid!: string;
×
13
    constructor(api: ResClient, rid: string, method?: string, params?: unknown) {
×
14
        super();
×
15
        Properties.of(this)
×
16
            .readOnly("api", api)
×
17
            .define("data", true, false, true)
×
18
            .readOnly("params", params)
×
19
            .define("code", true, true, true)
×
20
            .define("method", false, true, true, method)
×
21
            .define("message", true, true, true)
×
22
            .define("rid", false, true, true, rid);
×
23
    }
×
24

×
25
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
×
26
    protected async _listen(on: boolean): Promise<void> {
×
27
        // empty
×
28
    }
×
29

×
30
    async dispose(): Promise<void> {
×
31
        await this._listen(false);
×
32
    }
×
33

×
34
    async init(err: Partial<ErrorData> & { data?: unknown; }): Promise<this> {
×
35
        this.code = err.code || ErrorCodes.UNKNOWN;
×
36
        this.data = err.data || {};
×
37
        this.message = err.message ?? "Unknown Error";
×
38

×
39
        return this;
×
40
    }
×
41
}
×
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