KrzysFR
(Christophe Chevalier)
November 17, 2018, 12:30pm
1
While updating the list of error codes, I see that both errors 2021 and 2023 have the same transaction_read_only
label: https://apple.github.io/foundationdb/api-error-codes.html
This makes it difficult to use enums to model these, and I’ll have to change the name of one or the other.
Is this normal? It looks like 2021 could probably have an additional word in it (since it seems to go along with 2020 that seems to be when trying to get the commit version of a transaction)
ajbeamon
(A.J. Beamon)
November 26, 2018, 6:00pm
2
That looks like an error in the documentation. In the source code, 2021 is named no_commit_version
:
ERROR( version_invalid, 2011, "Version not valid" )
ERROR( range_limits_invalid, 2012, "Range limits not valid" )
ERROR( invalid_database_name, 2013, "Database name must be 'DB'" )
ERROR( attribute_not_found, 2014, "Attribute not found" )
ERROR( future_not_set, 2015, "Future not ready" )
ERROR( future_not_error, 2016, "Future not an error" )
ERROR( used_during_commit, 2017, "Operation issued while a commit was outstanding" )
ERROR( invalid_mutation_type, 2018, "Unrecognized atomic mutation type" )
ERROR( attribute_too_large, 2019, "Attribute too large for type int" )
ERROR( transaction_invalid_version, 2020, "Transaction does not have a valid commit version" )
ERROR( no_commit_version, 2021, "Transaction is read-only and therefore does not have a commit version" )
ERROR( environment_variable_network_option_failed, 2022, "Environment variable network option could not be set" )
ERROR( transaction_read_only, 2023, "Attempted to commit a transaction specified as read-only" )
ERROR( incompatible_protocol_version, 2100, "Incompatible protocol version" )
ERROR( transaction_too_large, 2101, "Transaction exceeds byte limit" )
ERROR( key_too_large, 2102, "Key length exceeds limit" )
ERROR( value_too_large, 2103, "Value length exceeds limit" )
ERROR( connection_string_invalid, 2104, "Connection string invalid" )
ERROR( address_in_use, 2105, "Local address in use" )
ERROR( invalid_local_address, 2106, "Invalid local address" )
I’ll fix the documentation.