registry admin script (#2426)

* registryadmin scripts

Add `start-sdk publish` command which can potentially replace
the Haskell implementation of `registry-publish upload`

* restructure modules

---------

Co-authored-by: Sam Sartor <me@samsartor.com>
This commit is contained in:
Aiden McClelland
2023-09-28 11:19:31 -06:00
committed by GitHub
parent 9a202cc124
commit f5da5f4ef0
12 changed files with 332 additions and 18 deletions

View File

@@ -3,6 +3,7 @@ use std::fmt::Display;
use color_eyre::eyre::eyre;
use patch_db::Revision;
use rpc_toolkit::hyper::http::uri::InvalidUri;
use rpc_toolkit::reqwest;
use rpc_toolkit::yajrc::RpcError;
use crate::InvalidId;
@@ -272,7 +273,12 @@ impl From<ssh_key::Error> for Error {
}
impl From<reqwest::Error> for Error {
fn from(e: reqwest::Error) -> Self {
Error::new(e, ErrorKind::Network)
let kind = match e {
_ if e.is_builder() => ErrorKind::ParseUrl,
_ if e.is_decode() => ErrorKind::Deserialization,
_ => ErrorKind::Network,
};
Error::new(e, kind)
}
}
impl From<patch_db::value::Error> for Error {