@adaas/a-server 0.0.26 → 0.0.27

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.
@@ -1904,6 +1904,16 @@ var A_HttpServer = class extends A_Service {
1904
1904
  case (error instanceof A_Error && error.originalError instanceof A_HttpServerError):
1905
1905
  wrappedError = error.originalError;
1906
1906
  break;
1907
+ // Duck-type: A_Error (e.g. A_FeatureError) wrapping an HttpError-like original.
1908
+ // A_Error.fromConstructor() unwraps nested A_Error chains, so originalError is
1909
+ // always the root non-A_Error cause — check it for a numeric statusCode.
1910
+ case (error instanceof A_Error && error.originalError instanceof Error && typeof error.originalError.statusCode === "number"):
1911
+ wrappedError = new A_HttpServerError({
1912
+ status: error.originalError.statusCode,
1913
+ description: error.originalError.message,
1914
+ originalError: error.originalError
1915
+ });
1916
+ break;
1907
1917
  // Duck-type: any Error with a numeric statusCode property (e.g. http-errors,
1908
1918
  // Express-style errors, or plain project HttpError classes). Honour the
1909
1919
  // status code so the caller gets the right 4xx / 5xx rather than a blanket 500.