- Build complete Next.js CRM for commercial real estate - Add authentication with JWT sessions and role-based access - Add GoHighLevel API integration for contacts, conversations, opportunities - Add AI-powered Control Center with tool calling - Add Setup page with onboarding checklist (/setup) - Add sidebar navigation with Setup menu item - Fix type errors in onboarding API, GHL services, and control center tools - Add Prisma schema with SQLite for local development - Add UI components with clay morphism design system Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24 lines
600 B
TypeScript
24 lines
600 B
TypeScript
export class GHLError extends Error {
|
|
constructor(
|
|
public statusCode: number,
|
|
message: string,
|
|
public responseBody?: string
|
|
) {
|
|
super(message);
|
|
this.name = 'GHLError';
|
|
}
|
|
|
|
static isRateLimitError(error: unknown): boolean {
|
|
return error instanceof GHLError && error.statusCode === 429;
|
|
}
|
|
|
|
static isAuthError(error: unknown): boolean {
|
|
return error instanceof GHLError &&
|
|
(error.statusCode === 401 || error.statusCode === 403);
|
|
}
|
|
|
|
static isNotFoundError(error: unknown): boolean {
|
|
return error instanceof GHLError && error.statusCode === 404;
|
|
}
|
|
}
|