Skip to content

the trait std::convert::From<&str> is not implemented for builders::java::throw::Error<&str> #9

Description

@sleipnir

Hello I am trying to compile my code and I get the following error:

error[E0277]: the trait bound `builders::java::throw::Error<&str>: std::convert::From<&str>` is not satisfied
  --> src/commands.rs:94:9
   |
94 |         throw_new!("Failure on create CloudState namespace");
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<&str>` is not implemented for `builders::java::throw::Error<&str>`
   |
   = note: required because of the requirements on the impl of `std::convert::Into<builders::java::throw::Error<&str>>` for `&str`
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: the trait bound `builders::java::throw::Error<&str>: std::convert::From<&str>` is not satisfied

My code:

fn create_namespace(namespace: String) -> Result<(), throw::Error<&'static str>> {
        println!("Creating CloudState namespace...");
        if let result = Command::new("kubectl")
            .arg("create")
            .arg("namespace")
            .arg(namespace)
            .spawn()
            .is_ok() {

            Ok(());
        };

        throw_new!("Failure on create CloudState namespace");
    }

What should I do to get around this error?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions