Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

KV error codes 10017 and 10026 no longer exist #1727

Merged
merged 1 commit into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/commands/kv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ fn kv_help(error_code: u16) -> &'static str {
// TODO: link to tool for this?
// legacy namespace errors
10021 | 10035 | 10038 => "Consider moving this namespace",
// cloudflare account errors
10017 | 10026 => "Workers KV is a paid feature, please upgrade your account (https://www.cloudflare.com/products/workers-kv/)",
_ => "",
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/kv/namespace/upsert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ pub fn upsert(
Ok(success) => Ok(UpsertedNamespace::Created(success.result)),
Err(e) => match &e {
ApiFailure::Error(_status, api_errors) => {
if api_errors.errors.iter().any(|e| e.code == 10026) {
failure::bail!("{}", http::format_error(e, Some(&error_suggestions)))
} else if api_errors.errors.iter().any(|e| e.code == 10014) {
if api_errors.errors.iter().any(|e| e.code == 10014) {
log::info!("Namespace {} already exists.", title);

match list(&client, target)?
Expand All @@ -47,7 +45,6 @@ pub fn upsert(

fn error_suggestions(code: u16) -> &'static str {
match code {
10026 => "You will need to enable Workers Bundled for your account before you can use this feature.",
10014 => "Namespace already exists, try using a different namespace.",
10037 => "Edit your API Token to have correct permissions, or use the 'Edit Cloudflare Workers' API Token template.",
_ => "",
Expand Down