mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 22:26:42 +02:00
chore: misc fixes, new services, lockfile cleanup
Assorted changes from recent sessions: - .gitignore: add mana-sync binary, Forgejo data - chat/web: add isSidebarMode to navigation store - clock/web: fix alarm page markup - contacts/mukke/presi/questions: add svelte.config.js aliases - context/web: add missing dependency - manacore/landing: update pricing page - manacore/web + todo/web: update mana dashboard pages - planta/web: fix dashboard layout - pnpm-lock.yaml: cleanup after backend removals - docs/APP_GAP_ANALYSIS.md: new gap analysis doc - services/mana-analytics: add Dockerfile - services/mana-subscriptions: new Go subscription service Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5d02b0419d
commit
8ccf8ff818
36 changed files with 1691 additions and 3468 deletions
29
services/mana-subscriptions/src/middleware/error-handler.ts
Normal file
29
services/mana-subscriptions/src/middleware/error-handler.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* Global error handler middleware for Hono.
|
||||
*/
|
||||
|
||||
import type { ErrorHandler } from 'hono';
|
||||
import { HTTPException } from 'hono/http-exception';
|
||||
|
||||
export const errorHandler: ErrorHandler = (err, c) => {
|
||||
if (err instanceof HTTPException) {
|
||||
const cause = err.cause as Record<string, unknown> | undefined;
|
||||
return c.json(
|
||||
{
|
||||
statusCode: err.status,
|
||||
message: err.message,
|
||||
...(cause ? { details: cause } : {}),
|
||||
},
|
||||
err.status
|
||||
);
|
||||
}
|
||||
|
||||
console.error('Unhandled error:', err);
|
||||
return c.json(
|
||||
{
|
||||
statusCode: 500,
|
||||
message: 'Internal server error',
|
||||
},
|
||||
500
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue