diff --git a/package-lock.json b/package-lock.json index 96af0eb2..5abceda7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@replit/river", - "version": "0.200.1", + "version": "0.200.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@replit/river", - "version": "0.200.1", + "version": "0.200.2", "license": "MIT", "dependencies": { "@msgpack/msgpack": "^3.0.0-beta2", diff --git a/package.json b/package.json index 630fdf8a..d3b757e3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@replit/river", "description": "It's like tRPC but... with JSON Schema Support, duplex streaming and support for service multiplexing. Transport agnostic!", - "version": "0.200.1", + "version": "0.200.2", "type": "module", "exports": { ".": { diff --git a/router/server.ts b/router/server.ts index 66ab69c6..15d7bfed 100644 --- a/router/server.ts +++ b/router/server.ts @@ -505,6 +505,20 @@ class RiverServer span.recordException(err instanceof Error ? err : new Error(errorMsg)); span.setStatus({ code: SpanStatusCode.ERROR }); + this.log?.error( + `${serviceName}.${procedureName} handler threw an uncaught error`, + { + ...loggingMetadata, + transportMessage: { + procedureName, + serviceName, + }, + extras: { + error: errorMsg, + }, + }, + ); + onServerCancel({ code: UNCAUGHT_ERROR_CODE, message: errorMsg, @@ -518,10 +532,7 @@ class RiverServer } else if (procedure.type === 'rpc' || procedure.type === 'subscription') { // Though things can work just fine if they eventually follow up with a stream // control message with a close bit set, it's an unusual client implementation! - this.log?.warn('sent an init without a stream close', { - ...loggingMetadata, - clientId: this.transport.clientId, - }); + this.log?.warn('sent an init without a stream close', loggingMetadata); } const handlerContext: ProcedureHandlerContext = {