Repository: rust-cli/human-panic (language: rust)

Issue:
Report contains less info than normal panic output
## Expected Behavior

Without human-panic, my program says

    thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21

I'd expect the report file to contain this information, as well.

## Current Behavior

The "unwrap on a Non value" information is gone. The report only says

```
explanation = '''
Panic occurred in file 'libcore/option.rs' at line 335
'''
method = 'Panic'
```

## Your Environment

I'm using human-panic 1.0.0.


Discussion / hints:

Fix patch:
diff --git a/src/lib.rs b/src/lib.rs
index bc70e69..90c7f53 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -42,6 +42,7 @@
 
 #![cfg_attr(feature = "nightly", deny(missing_docs))]
 #![cfg_attr(feature = "nightly", feature(external_doc))]
+#![cfg_attr(feature = "nightly", feature(panic_info_message))]
 
 extern crate backtrace;
 #[macro_use]
@@ -179,6 +180,15 @@ pub fn print_msg<P: AsRef<Path>>(
 /// Utility function which will handle dumping information to disk
 pub fn handle_dump(meta: &Metadata, panic_info: &PanicInfo) -> Option<PathBuf> {
   let mut expl = String::new();
+  #[cfg(feature = "nightly")]
+  let cause = match panic_info.message() {
+    Some(m) => format!("{}", m),
+    None => "Unknown".into(),
+  };
+
+  #[cfg(not(feature = "nightly"))]
+  let cause =
+    String::from("Error cause could not be determined by the application.");
 
   let payload = panic_info.payload().downcast_ref::<&str>();
   if let Some(payload) = payload {
@@ -194,7 +204,8 @@ pub fn handle_dump(meta: &Metadata, panic_info: &PanicInfo) -> Option<PathBuf> {
     None => expl.push_str("Panic location unknown.\n"),
   }
 
-  let report = Report::new(&meta.name, &meta.version, Method::Panic, expl);
+  let report =
+    Report::new(&meta.name, &meta.version, Method::Panic, expl, cause);
 
   match report.persist() {
     Ok(f) => Some(f),
diff --git a/src/report.rs b/src/report.rs
index e6b1726..4e28e46 100644
--- a/src/report.rs
+++ b/src/report.rs
@@ -23,6 +23,7 @@ pub struct Report {
   operating_system: Cow<'static, str>,
   crate_version: String,
   explanation: String,
+  cause: String,
   method: Method,
   backtrace: String,
 }
@@ -34,6 +35,7 @@ impl Report {
     version: &str,
     method: Method,
     explanation: String,
+    cause: String,
   ) -> Self {
     let operating_system = if cfg!(windows) {
       "windows".into()
@@ -50,6 +52,7 @@ impl Report {
       operating_system,
       method,
       explanation,
+      cause,
       backtrace,
     }
   }


Test patch: