diff --git a/common/changes/@itwin/core-backend/serialize-error_2024-10-01-13-46.json b/common/changes/@itwin/core-backend/serialize-error_2024-10-01-13-46.json new file mode 100644 index 000000000000..99b35bb89b62 --- /dev/null +++ b/common/changes/@itwin/core-backend/serialize-error_2024-10-01-13-46.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-backend", + "comment": "", + "type": "none" + } + ], + "packageName": "@itwin/core-backend" +} \ No newline at end of file diff --git a/core/backend/src/rpc/web/response.ts b/core/backend/src/rpc/web/response.ts index 89ee807bac92..1485e66d0d81 100644 --- a/core/backend/src/rpc/web/response.ts +++ b/core/backend/src/rpc/web/response.ts @@ -6,7 +6,7 @@ * @module RpcInterface */ -import { Logger } from "@itwin/core-bentley"; +import { BentleyError, Logger } from "@itwin/core-bentley"; import { CommonLoggerCategory, HttpServerRequest, @@ -157,7 +157,7 @@ function logResponse(request: SerializedRpcRequest, statusCode: number, resultOb path: request.path, operation: request.operation, statusCode, - errorObj: resultObj instanceof Error ? resultObj : undefined, + errorObj: resultObj instanceof Error ? BentleyError.getErrorProps(resultObj) : undefined, }; if (statusCode < 400)