Skip to content

Commit

Permalink
Clarify comment on default error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelff committed Nov 22, 2022
1 parent 60b7b44 commit a13c40c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/client/src/runtime/getPrismaClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,13 @@ export function getPrismaClient(config: GetPrismaClientConfig) {
validatePrismaClientOptions(optionsArg, config.datasourceNames)
}

const logEmitter = new EventEmitter().on('error', () => {
// to prevent unhandled error events
const logEmitter = new EventEmitter().on('error', (e) => {
// this is a no-op to prevent unhandled error events
//
// If the user enabled error logging this would never be executed. If the user did not
// enabled error logging, this would be executed, and a trace for the error would be logged
// in debug mode, which is like going in the opposite direction than what the user wanted by
// not enabling error logging in the first place.
})

this._extensions = []
Expand Down

0 comments on commit a13c40c

Please sign in to comment.