diff --git a/handlers/reports/parseExcel.handler.js b/handlers/reports/parseExcel.handler.js index f3ccca0..7bedf74 100644 --- a/handlers/reports/parseExcel.handler.js +++ b/handlers/reports/parseExcel.handler.js @@ -137,7 +137,7 @@ export default async (ctx) => { sseClientCtx.res.sendSSEJson(parseResultCount, "done"); } catch (error) { console.error(error); - sseClientCtx.res.sendSSEJson({ error: serializeError(error) }, "error"); + sseClientCtx.res.sendSSEJson({ error: serializeError(error) }, "parseError"); } finally { sseClientCtx.local.isParsing = false; } diff --git a/http-server/route.js b/http-server/route.js index e9fb372..e334bf8 100644 --- a/http-server/route.js +++ b/http-server/route.js @@ -19,7 +19,9 @@ export async function routeHandler(url, ctxStorage, routeMap) { if (url.pathname in routeMap) { const route = routeMap[url.pathname]; - if (route.method !== req.req.method) throw new MethodNotAllowedError(); + if (route.method !== req.req.method) { + throw new MethodNotAllowedError(); + } if (req.req.headers["content-type"]?.includes("application/json")) { ctx.data = await ctx.req.parseJson();