summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc/captcha-error.ts
blob: 217018ec68ee294c343bf0641ef9691499e81447 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * SPDX-FileCopyrightText: syuilo and misskey-project
 * SPDX-License-Identifier: AGPL-3.0-only
 */

import type { CaptchaErrorCode } from '@/core/CaptchaService.js';

export class CaptchaError extends Error {
	public readonly code: CaptchaErrorCode;
	public readonly cause?: unknown;

	constructor(code: CaptchaErrorCode, message: string, cause?: unknown) {
		super(message, cause ? { cause } : undefined);
		this.code = code;
		this.cause = cause;
		this.name = 'CaptchaError';
	}
}