dolt
dolt copied to clipboard
Return error codes for merge failures
Sometimes when merges fail, there's more context / nuance than can reasonably be displayed in an error message.
The motivating example here is a case where a branch contains changes to the primary key schema. In these cases, we can't merge, and we instruct the user to manually make the table identical on both branches. If the user does this, then we can skip merging that table.
So when we hit this failure state, the user could be trying to do a couple different things:
- The user is not aware that they need to manually make the tables identical, and we need to inform them.
- The user attempted to make the tables identical, but did not succeed because there's a schema change they aren't aware of.
- The user attempted to make the tables identical, but did not succeed because there's a data change they aren't aware of.
Conveying all of the necessary context and information to address all of these possible situations would make the error message unwieldy. But if Dolt returned a succinct message and an error code, we could have a section in the documentation that describes the error codes in more detail and proposes remedies.