ToolJet/plugins/packages/common/lib/query.error.ts
gsmithun4 f40be5b1b5 feat(logging): integrate transaction logging across various guards and services
- Updated `AbilityGuard` to utilize `TransactionLogger` for logging execution time and errors.
- Enhanced `ResponseInterceptor` to include transaction metadata in logs.
- Modified `QueryAuthGuard`, `ValidateQueryAppGuard`, and `ValidateQuerySourceGuard` to log completion times and transaction IDs.
- Introduced `TransactionLogger` service for structured logging with transaction context.
- Added transaction ID and route information to request context in `RequestContextMiddleware`.
- Updated `JwtStrategy` to log validation completion times.
- Refactored logging configuration in `AppModuleLoader` to support pretty printing in non-production environments.
- Removed console logs in favor of structured logging for better traceability.
2025-09-19 02:08:49 +05:30

23 lines
715 B
TypeScript

export class QueryError extends Error {
data: Record<string, unknown>;
description: any;
metadata?: unknown;
constructor(message: string | undefined, description: unknown, data: Record<string, unknown>, metadata?: unknown) {
super(message);
this.name = this.constructor.name;
this.data = data;
this.description = description;
this.metadata = metadata;
}
}
export class OAuthUnauthorizedClientError extends Error {
data: Record<string, unknown>;
description: any;
constructor(message: string | undefined, description: any, data: Record<string, unknown>) {
super(message);
this.name = this.constructor.name;
this.data = data;
this.description = description;
}
}