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

yiming-liao / logry / 18439742378

12 Oct 2025 05:30AM UTC coverage: 96.196% (+0.4%) from 95.783%
18439742378

push

github

yiming-liao
chore(release): bump version to 1.2.2

463 of 513 branches covered (90.25%)

Branch coverage included in aggregate %.

3937 of 4061 relevant lines covered (96.95%)

3.99 hits per line

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

80.56
/src/core/handler-manager/utils/init-handler.ts
1
import type { OnErrorCallback } from "@/core/handler-manager/handler-manager-config-types";
1✔
2
import type { Handler } from "@/core/handler-manager/types";
1✔
3
import { isHandlerClass } from "@/core/handler-manager/utils/is-handler-class";
1✔
4

1✔
5
/**
1✔
6
 * Initialize the handler by calling its init method asynchronously if present.
1✔
7
 *
1✔
8
 * If the handler is a class with an init function, invoke it and
1✔
9
 * handle any initialization errors by calling onError callback.
1✔
10
 *
1✔
11
 * @param params.handler - The handler instance or object.
1✔
12
 * @param params.id - Identifier for the handler, passed to onError if any.
1✔
13
 * @param params.onError - Optional callback to handle errors during init.
1✔
14
 */
1✔
15
export const initHandler = ({
1✔
16
  handler,
6✔
17
  id,
6✔
18
  onError,
6✔
19
}: {
6✔
20
  handler: Handler;
6✔
21
  id: string;
6✔
22
  onError?: OnErrorCallback;
6✔
23
}): void => {
6✔
24
  if (isHandlerClass(handler) && typeof handler.init === "function") {
6!
25
    // Call init asynchronously, catch errors and report
×
26
    Promise.resolve()
×
27
      .then(() => handler.init?.())
✔
28
      .catch((error) => onError?.({ error, id }));
✔
29
  }
×
30
};
6✔
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