Turn on custom-error-definition and name the custom errors

This commit is contained in:
Danny Kim
2026-10-19 19:45:02 +09:00
parent d879b04e46
commit 71150900ff
3 changed files with 12 additions and 5 deletions
+6 -1
View File
@@ -36,7 +36,12 @@ const failureComment = (failures: ProfileFailure[]): string =>
// The `fetch` subset the reviewer posts through, which tests replace.
export type Fetcher = (url: string, init: RequestInit) => Promise<Response>;
class GiteaRequestError extends Error {}
class GiteaRequestError extends Error {
constructor(message: string, options?: ErrorOptions) {
super(message, options);
this.name = "GiteaRequestError";
}
}
function parseAnchors(text: string, sourcePath: string): Anchor[] {
const entries: unknown = JSON.parse(text);