feat: 基本实现拆单收货

This commit is contained in:
2026-07-29 15:53:23 +08:00
parent c443109869
commit 1b45f9dac6
92 changed files with 3223 additions and 22968 deletions
+17
View File
@@ -0,0 +1,17 @@
import { fail } from './http.js'
export type Context = Record<string, unknown>
export type FunctionHandler = (request: Request, context: Context) => Promise<Response> | Response
export const withErrorBoundary = (handler: FunctionHandler): FunctionHandler => {
return async (request, context) => {
try {
return await handler(request, context)
} catch (error) {
console.error(error)
return fail('服务异常,请稍后再试', 500, 'INTERNAL_SERVER_ERROR')
}
}
}