@spfn/core 0.1.0-alpha.74 → 0.1.0-alpha.81

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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AppFactory, ServerConfig, createServer, startServer } from './server/index.js';
2
- export { H as HttpMethod, I as InferContract, R as RouteContext, a as RouteContract, b as RouteHandler, i as isHttpMethod } from './types-Dzggq1Yb.js';
2
+ export { H as HttpMethod, I as InferContract, R as RouteContext, a as RouteContract, b as RouteHandler, i as isHttpMethod } from './types-DYueuoD6.js';
3
3
  import 'hono';
4
4
  import 'hono/cors';
5
5
  import '@hono/node-server';
package/dist/index.js CHANGED
@@ -2951,13 +2951,20 @@ function ErrorHandler(options = {}) {
2951
2951
  const errorType = err.name || "Error";
2952
2952
  if (enableLogging) {
2953
2953
  const logLevel = statusCode >= 500 ? "error" : "warn";
2954
- errorLogger[logLevel]("Error occurred", {
2954
+ const logData = {
2955
2955
  type: errorType,
2956
2956
  message: err.message,
2957
2957
  statusCode,
2958
2958
  path: c.req.path,
2959
2959
  method: c.req.method
2960
- });
2960
+ };
2961
+ if (errorWithCode.details) {
2962
+ logData.details = errorWithCode.details;
2963
+ }
2964
+ if (statusCode >= 500 && includeStack) {
2965
+ logData.stack = err.stack;
2966
+ }
2967
+ errorLogger[logLevel]("Error occurred", logData);
2961
2968
  }
2962
2969
  const response = {
2963
2970
  success: false,