diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-03-25 11:02:42 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-03-25 09:51:11 -0700 |
| commit | af18098c9d2b2e165aca127c35eeb98d157bd542 (patch) | |
| tree | b8afafa5d24c559cb4b0c378f59e19abd3da9ddd /reftable/reftable-error.h | |
| parent | 630942a873ae0f1d067efaaf7b4d1b05cfb3a141 (diff) | |
| download | git-af18098c9d2b2e165aca127c35eeb98d157bd542.tar.xz | |
reftable/error: discern locked/outdated errors
We currently throw two different errors into a similar-but-different
error code:
- Errors when trying to lock the reftable stack.
- Errors when trying to write to the reftable stack which has been
modified concurrently.
This results in unclear error handling and user-visible error messages.
Create a new `REFTABLE_OUTDATED_ERROR` so that those error conditions
can be clearly told apart from each other. Adjust users of the old
`REFTABLE_LOCK_ERROR` to use the new error code as required.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/reftable-error.h')
| -rw-r--r-- | reftable/reftable-error.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/reftable/reftable-error.h b/reftable/reftable-error.h index 4c457aaaf8..e9b07c9f36 100644 --- a/reftable/reftable-error.h +++ b/reftable/reftable-error.h @@ -25,7 +25,7 @@ enum reftable_error { */ REFTABLE_NOT_EXIST_ERROR = -4, - /* Trying to write out-of-date data. */ + /* Trying to access locked data. */ REFTABLE_LOCK_ERROR = -5, /* Misuse of the API: @@ -57,6 +57,9 @@ enum reftable_error { /* Entry does not fit. This can happen when writing outsize reflog messages. */ REFTABLE_ENTRY_TOO_BIG_ERROR = -11, + + /* Trying to write out-of-date data. */ + REFTABLE_OUTDATED_ERROR = -12, }; /* convert the numeric error code to a string. The string should not be |
