class RbSys::CargoMetadataError

Raised when Cargo metadata cannot be parsed.

def initialize(err, stderr)

def initialize(err, stderr)
  msg = <<~MSG.chomp.tr("\n", " ")
    Could not infer Rust crate information using `cargo metadata`.
    Original error was:
      #{err.class}: #{err.message}
    Things to check:
      - Check that your ext/*/Cargo.toml at is valid
      - If you are using a workspace, make sure you are the root Cargo.toml exists
      - Make sure `cargo` is installed and in your PATH
  MSG
  if !stderr.empty?
    indented_stderr = stderr.lines.map { |line| "  #{line}" }.join
    msg << "Stderr from `cargo metadata` was:\n#{indented_stderr}"
  end
  super(msg)
end