Skip to content

Conversation

prestonvasquez
Copy link
Member

@prestonvasquez prestonvasquez commented Nov 13, 2023

GODRIVER-2616

Summary

Change CommadFailedEvent.Failure type from string to error.

Background & Motivation

The original proposal for the command monitoring event api was given in ecbcd69 . It is unclear why a string type was chosen for failure. The specifications concerning a failed event states the following about the failure type:

Returns the failure. Based on the language, this SHOULD be a message string, exception object, or error document.

Since a Go error is a wrapper for a function that returns a string, I think it is reasonable to assume that a Go error falls under the "string" type.

The original POC is given in PR #1105

@prestonvasquez prestonvasquez requested a review from a team as a code owner November 13, 2023 18:59
@prestonvasquez prestonvasquez requested review from matthewdale and removed request for a team November 13, 2023 18:59
Copy link
Contributor

API Change Report

./event

incompatible changes

CommandFailedEvent.Failure: changed from string to error

Copy link
Collaborator

@matthewdale matthewdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@blink1073 blink1073 changed the title GODRIVER-2616 Change CommadFailedEvent.Failure type to error GODRIVER-2616 Change CommandFailedEvent.Failure type to error Nov 14, 2023
@prestonvasquez prestonvasquez merged commit 5ca3832 into mongodb:master Nov 14, 2023
@prestonvasquez prestonvasquez deleted the GODRIVER-2616 branch November 14, 2023 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants