mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-25 00:22:43 -05:00
fix(core): declare inherited APIError properties to fix TypeScript type resolution
This commit is contained in:
committed by
Gustavo Valverde
parent
503e95c7fd
commit
b463d59d3c
@@ -11,7 +11,15 @@ export class BetterAuthError extends Error {
|
||||
|
||||
export { type APIErrorCode, BASE_ERROR_CODES } from "./codes";
|
||||
|
||||
type BaseAPIErrorInstance = InstanceType<typeof BaseAPIError>;
|
||||
|
||||
export class APIError extends BaseAPIError {
|
||||
declare status: BaseAPIErrorInstance["status"];
|
||||
declare body: BaseAPIErrorInstance["body"];
|
||||
declare headers: BaseAPIErrorInstance["headers"];
|
||||
declare statusCode: BaseAPIErrorInstance["statusCode"];
|
||||
declare message: string;
|
||||
|
||||
constructor(...args: ConstructorParameters<typeof BaseAPIError>) {
|
||||
super(...args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user