mirror of
https://github.com/AleoHQ/leo.git
synced 2024-09-23 04:58:17 +03:00
fix ugly errors
This commit is contained in:
parent
5ab4d62a2b
commit
948188ddaf
@ -22,7 +22,6 @@ use crate::{
|
|||||||
errors::{
|
errors::{
|
||||||
commands::PublishError::{ConnectionUnavalaible, PackageNotPublished},
|
commands::PublishError::{ConnectionUnavalaible, PackageNotPublished},
|
||||||
CLIError,
|
CLIError,
|
||||||
CLIError::PublishError,
|
|
||||||
PublishError::{MissingPackageDescription, MissingPackageLicense, MissingPackageRemote},
|
PublishError::{MissingPackageDescription, MissingPackageLicense, MissingPackageRemote},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -82,16 +81,16 @@ impl CLI for PublishCommand {
|
|||||||
let package_version = package_manifest.get_package_version();
|
let package_version = package_manifest.get_package_version();
|
||||||
|
|
||||||
if package_manifest.get_package_description().is_none() {
|
if package_manifest.get_package_description().is_none() {
|
||||||
return Err(PublishError(MissingPackageDescription));
|
return Err(MissingPackageDescription.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
if package_manifest.get_package_license().is_none() {
|
if package_manifest.get_package_license().is_none() {
|
||||||
return Err(PublishError(MissingPackageLicense));
|
return Err(MissingPackageLicense.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
let package_remote = match package_manifest.get_package_remote() {
|
let package_remote = match package_manifest.get_package_remote() {
|
||||||
Some(remote) => remote,
|
Some(remote) => remote,
|
||||||
None => return Err(PublishError(MissingPackageRemote)),
|
None => return Err(MissingPackageRemote.into()),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create the output directory
|
// Create the output directory
|
||||||
@ -150,12 +149,12 @@ impl CLI for PublishCommand {
|
|||||||
Ok(json) => json,
|
Ok(json) => json,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
tracing::warn!("{:?}", error);
|
tracing::warn!("{:?}", error);
|
||||||
return Err(PublishError(PackageNotPublished("Package not published".into())));
|
return Err(PackageNotPublished("Package not published".into()).into());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
tracing::warn!("{:?}", error);
|
tracing::warn!("{:?}", error);
|
||||||
return Err(PublishError(ConnectionUnavalaible("Connection error".into())));
|
return Err(ConnectionUnavalaible("Connection error".into()).into());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user