diff --git a/backend/src/lib/errors.ts b/backend/src/lib/errors.ts deleted file mode 100644 index dd79e9e..0000000 --- a/backend/src/lib/errors.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Re-export from @bytelyst/errors — shared across all services. - */ -export { - ServiceError, - BadRequestError, - UnauthorizedError, - ForbiddenError, - NotFoundError, - ConflictError, - TooManyRequestsError, -} from '@bytelyst/errors'; diff --git a/backend/src/lib/request-context.ts b/backend/src/lib/request-context.ts index 731877f..24ccf19 100644 --- a/backend/src/lib/request-context.ts +++ b/backend/src/lib/request-context.ts @@ -3,7 +3,7 @@ */ import type { FastifyRequest } from 'fastify'; -import { BadRequestError } from './errors.js'; +import { BadRequestError } from '@bytelyst/errors'; export interface JwtPayload { sub: string; diff --git a/backend/src/modules/households/routes.ts b/backend/src/modules/households/routes.ts index 5eb4931..cb95c82 100644 --- a/backend/src/modules/households/routes.ts +++ b/backend/src/modules/households/routes.ts @@ -14,7 +14,7 @@ import crypto from 'node:crypto'; import type { FastifyInstance } from 'fastify'; -import { BadRequestError, NotFoundError, ForbiddenError, ConflictError } from '../../lib/errors.js'; +import { BadRequestError, NotFoundError, ForbiddenError, ConflictError } from '@bytelyst/errors'; import { extractAuth } from '../../lib/auth.js'; import * as repo from './repository.js'; import { diff --git a/backend/src/modules/routines/routes.ts b/backend/src/modules/routines/routes.ts index e5f5c6d..7290b71 100644 --- a/backend/src/modules/routines/routes.ts +++ b/backend/src/modules/routines/routes.ts @@ -11,7 +11,7 @@ */ import type { FastifyInstance } from 'fastify'; -import { BadRequestError, NotFoundError, ConflictError } from '../../lib/errors.js'; +import { BadRequestError, NotFoundError, ConflictError } from '@bytelyst/errors'; import { extractAuth } from '../../lib/auth.js'; import * as repo from './repository.js'; import { diff --git a/backend/src/modules/shared-timers/routes.ts b/backend/src/modules/shared-timers/routes.ts index 32f46e3..b75c056 100644 --- a/backend/src/modules/shared-timers/routes.ts +++ b/backend/src/modules/shared-timers/routes.ts @@ -13,7 +13,7 @@ import crypto from 'node:crypto'; import type { FastifyInstance } from 'fastify'; -import { BadRequestError, NotFoundError, ForbiddenError } from '../../lib/errors.js'; +import { BadRequestError, NotFoundError, ForbiddenError } from '@bytelyst/errors'; import { extractAuth } from '../../lib/auth.js'; import { getHousehold } from '../households/repository.js'; import * as repo from './repository.js'; diff --git a/backend/src/modules/timers/routes.ts b/backend/src/modules/timers/routes.ts index 160bacd..e13a249 100644 --- a/backend/src/modules/timers/routes.ts +++ b/backend/src/modules/timers/routes.ts @@ -11,7 +11,7 @@ */ import type { FastifyInstance } from 'fastify'; -import { BadRequestError, NotFoundError, ConflictError } from '../../lib/errors.js'; +import { BadRequestError, NotFoundError, ConflictError } from '@bytelyst/errors'; import { extractAuth } from '../../lib/auth.js'; import * as repo from './repository.js'; import { diff --git a/backend/src/modules/webhooks/repository.ts b/backend/src/modules/webhooks/repository.ts index fab0bc3..f6a9337 100644 --- a/backend/src/modules/webhooks/repository.ts +++ b/backend/src/modules/webhooks/repository.ts @@ -1,5 +1,5 @@ import { getCollection } from '../../lib/datastore.js'; -import { NotFoundError, ConflictError } from '../../lib/errors.js'; +import { NotFoundError, ConflictError } from '@bytelyst/errors'; import type { WebhookSubscriptionDoc, WebhookEventDoc, diff --git a/backend/src/modules/webhooks/routes.ts b/backend/src/modules/webhooks/routes.ts index aedfd9c..57677b3 100644 --- a/backend/src/modules/webhooks/routes.ts +++ b/backend/src/modules/webhooks/routes.ts @@ -8,7 +8,7 @@ import { import * as repo from './repository.js'; import { dispatchEvent } from './dispatcher.js'; import { extractAuth } from '../../lib/auth.js'; -import { BadRequestError } from '../../lib/errors.js'; +import { BadRequestError } from '@bytelyst/errors'; const PRODUCT_ID = 'chronomind';