{"action":"opened","issue":{"url":"https://api.github.com/repos/killercup/cargo-edit/issues/209","repository_url":"https://api.github.com/repos/killercup/cargo-edit","labels_url":"https://api.github.com/repos/killercup/cargo-edit/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/killercup/cargo-edit/issues/209/comments","events_url":"https://api.github.com/repos/killercup/cargo-edit/issues/209/events","html_url":"https://github.com/killercup/cargo-edit/issues/209","id":313086487,"number":209,"title":"Panic when crate not found","user":{"login":"theduke","id":241621,"avatar_url":"https://avatars1.githubusercontent.com/u/241621?v=4","gravatar_id":"","url":"https://api.github.com/users/theduke","html_url":"https://github.com/theduke","followers_url":"https://api.github.com/users/theduke/followers","following_url":"https://api.github.com/users/theduke/following{/other_user}","gists_url":"https://api.github.com/users/theduke/gists{/gist_id}","starred_url":"https://api.github.com/users/theduke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theduke/subscriptions","organizations_url":"https://api.github.com/users/theduke/orgs","repos_url":"https://api.github.com/users/theduke/repos","events_url":"https://api.github.com/users/theduke/events{/privacy}","received_events_url":"https://api.github.com/users/theduke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-10T20:57:41Z","updated_at":"2018-04-10T20:57:41Z","closed_at":null,"author_association":"NONE","body":"Just upgrade my nightly to (4b9b70c39 2018-04-09), and it seems that `cargo-add` does not handle non-existant crates gracefully anymore.\r\n\r\nI mistyped a crate (`serde_dervie`) and got this error: \r\n\r\n```\r\nCommand failed due to unhandled error: Invalid JSON (the crate may not exist)\r\nCaused by: missing field `versions` at line 1 column 35\r\nBacktrace: stack backtrace:\r\n   0:     0x55b7225d188c - backtrace::backtrace::trace::heda8b332efd986ab\r\n   1:     0x55b7225d0072 - backtrace::capture::Backtrace::new::h727f6efd73fa06c5\r\n   2:     0x55b7225cfb2c - error_chain::make_backtrace::h4659a0010e2ff03a\r\n   3:     0x55b722448398 - <core::result::Result<T, E> as cargo_edit::errors::ResultExt<T>>::chain_err::h49285f85800c0898\r\n   4:     0x55b72245474b - cargo_edit::fetch::get_latest_dependency::h99ea9f82808078df\r\n   5:     0x55b72243bfb7 - cargo_add::args::Args::parse_dependencies::h235fd639915b3939\r\n   6:     0x55b7224421df - cargo_add::main::h8de47bb74222f147\r\n   7:     0x55b72243ab42 - std::rt::lang_start::{{closure}}::h97d95e748c99d208\r\n   8:     0x55b722688137 - std::rt::lang_start_internal::{{closure}}::h81dab1c80d2e9e5d\r\n                        at libstd/rt.rs:59\r\n                         - std::panicking::try::do_call::h7973a503106e370a\r\n                        at libstd/panicking.rs:305\r\n   9:     0x55b722699afe - __rust_maybe_catch_panic\r\n                        at libpanic_unwind/lib.rs:102\r\n  10:     0x55b72267dab5 - std::panicking::try::h21b7d973eaa3febb\r\n                        at libstd/panicking.rs:284\r\n                         - std::panic::catch_unwind::h07d8c36256237e04\r\n                        at libstd/panic.rs:361\r\n                         - std::rt::lang_start_internal::hde534450bd97bd5e\r\n                        at libstd/rt.rs:58\r\n  11:     0x55b722442ef3 - main\r\n  12:     0x7fddf0444f49 - __libc_start_main\r\n  13:     0x55b722438db9 - _start\r\n  14:                0x0 - <unknown>\r\n```"}}
{"actor":{"display_login":"theduke"}}