This commit improves the error handling of the key-value store mysql
implementation with the following changes:
Renames the mysql structure to mysqlCtx, so that mysql refers to the
mysql driver package. This allows us to reference errors from the
mysql driver package.
Updates the put() function to returned a ErrDuplicateEntry error when
the caller is attempting to save data using a key that already exists
in the database. Automatic overwrites are not allowed by the key-value
store. Returning this error allows the caller to decide if it would
like to manually delete the entry and save a newer version of it.
Replaces fmt.Errorf errors with errors.Errorf errors so that stack
traces are available.
This commit improves the error handling of the key-value store mysql implementation with the following changes:
Renames the mysql structure to mysqlCtx, so that mysql refers to the mysql driver package. This allows us to reference errors from the mysql driver package.
Updates the put() function to returned a ErrDuplicateEntry error when the caller is attempting to save data using a key that already exists in the database. Automatic overwrites are not allowed by the key-value store. Returning this error allows the caller to decide if it would like to manually delete the entry and save a newer version of it.
Replaces fmt.Errorf errors with errors.Errorf errors so that stack traces are available.