@fuzionx/framework 0.1.69 → 0.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@fuzionx/player": "^0.1.69",
12
+ "@fuzionx/player": "^0.1.70",
13
13
  "pinia": "^3.0.4",
14
14
  "vue": "^3.5.0",
15
15
  "vue-router": "^4.5.0"
@@ -813,6 +813,7 @@ export default class Application {
813
813
  chainResult = this._executeSyncChain(middlewareFns, ctx, resolvedHandler);
814
814
  }
815
815
  } catch (err) {
816
+ console.error(`[FX] Unhandled controller error: ${ctx.method} ${ctx.path}`, err);
816
817
  this._handleContextError(err, ctx);
817
818
  return ctx._toFusionResponse();
818
819
  }
@@ -828,6 +829,7 @@ export default class Application {
828
829
  this._sendContextResponse(rawReq.requestId, ctx);
829
830
  })
830
831
  .catch((err) => {
832
+ console.error(`[FX] Unhandled controller error: ${ctx.method} ${ctx.path}`, err);
831
833
  this._handleContextError(err, ctx);
832
834
  this._sendContextResponse(rawReq.requestId, ctx);
833
835
  });
@@ -1214,6 +1216,17 @@ export default class Application {
1214
1216
  }
1215
1217
  }
1216
1218
  this._errorHandler.handle(err, ctx);
1219
+
1220
+ // 'error' 이벤트 발행 — 앱 레벨에서 ErrorLog 기록용 (fire-and-forget)
1221
+ this.emit('error', {
1222
+ error: err,
1223
+ method: ctx.method,
1224
+ path: ctx.path,
1225
+ appName: ctx.appName,
1226
+ user: ctx.user || null,
1227
+ ip: ctx.ip,
1228
+ userAgent: ctx.get?.('user-agent') || '',
1229
+ }).catch(() => {});
1217
1230
  }
1218
1231
 
1219
1232
  /**
@@ -27,9 +27,11 @@ export default class ErrorHandler {
27
27
  handle(err, ctx) {
28
28
  const status = err.status || 500;
29
29
 
30
- // 500 에러는 로깅
30
+ // 모든 에러 로깅: 500+ error, 400+ → warn
31
31
  if (status >= 500) {
32
32
  this.logger(err);
33
+ } else if (status >= 400) {
34
+ this.logger(`[${status}] ${ctx.method} ${ctx.path} — ${err.message}`);
33
35
  }
34
36
 
35
37
  // JSON 응답 요청이면 JSON으로
@@ -147,7 +147,8 @@ export default class Storage {
147
147
  // AWS S3 기본 URL
148
148
  return `https://${this._s3.bucket}.s3.${this._s3.region || 'us-east-1'}.amazonaws.com/${filePath}`;
149
149
  }
150
- return `/storage/${filePath}`;
150
+ // return `/storage/${filePath}`;
151
+ return filePath;
151
152
  }
152
153
 
153
154
  // ── S3 호환 스토리지 구현 (@aws-sdk/client-s3) ──
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzionx/framework",
3
- "version": "0.1.69",
3
+ "version": "0.1.70",
4
4
  "type": "module",
5
5
  "description": "Full-stack MVC framework built on @fuzionx/core — Controller, Service, Model, Middleware, DI, EventBus",
6
6
  "main": "index.js",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@aws-sdk/client-s3": "^3.1028.0",
38
- "@fuzionx/core": "^0.1.69",
38
+ "@fuzionx/core": "^0.1.70",
39
39
  "better-sqlite3": "^12.8.0",
40
40
  "knex": "^3.2.5",
41
41
  "mongoose": "^9.3.2",