From 5d5fc5802742ed5ce6cda1a50a12bbbcf4ee3c04 Mon Sep 17 00:00:00 2001 From: PoiScript Date: Tue, 5 Nov 2019 17:04:03 +0800 Subject: [PATCH] feat: better error message for validation failure --- src/validate.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/validate.rs b/src/validate.rs index 1f41666..044cd00 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -185,11 +185,13 @@ impl Org<'_> { if cfg!(debug_assertions) { let errors = self.validate(); if !errors.is_empty() { - eprintln!("Validation failed. {} error(s) found:", errors.len()); - for err in &errors { + eprintln!("Org validation failed. {} error(s) found:", errors.len()); + for err in errors { eprintln!("{:?} at {:?}", err, err.element(self)); } - panic!(); + panic!( + "Looks like there's a bug in orgize! Please report it with your org-mode content at https://github.com/PoiScript/orgize/issues." + ); } } }