pub struct SimpleErrorReport<'a> {
pub error_report: &'a ErrorReport,
}Expand description
Simple implementation of SubmitErrorReport.
Generates a structured, markdown-formatted error report suitable for both humans and AI/LLMs. Does not generate URLs — the report is the output.
Respects the NO_COLOR environment variable: when set, terminal hyperlinks
are disabled, producing clean plain text (markdown is unaffected).
§Example
use charon_error::prelude::*;
use charon_error::prelude::simple_er::*;
use charon_error::LinkDebugIde;
SimpleErrorReport::setup_global_config(SimpleERGlobalSettings {
link_format: LinkDebugIde::Vscode,
}).unwrap_error();Fields§
§error_report: &'a ErrorReportReference to the error report being formatted.
Implementations§
Source§impl<'a> SimpleErrorReport<'a>
impl<'a> SimpleErrorReport<'a>
Sourcepub fn setup_global_config(
config: SimpleERGlobalSettings,
) -> Result<(), ErrorReport>
pub fn setup_global_config( config: SimpleERGlobalSettings, ) -> Result<(), ErrorReport>
Initialize the global simple report configuration. Must be called once at startup.
Returns an error if called more than once.
Sourcepub fn get_global_config() -> Result<RwLockReadGuard<'static, SimpleERGlobalSettings>, ErrorReport>
pub fn get_global_config() -> Result<RwLockReadGuard<'static, SimpleERGlobalSettings>, ErrorReport>
Read the global simple report configuration. Returns an error if not yet set.
Trait Implementations§
Source§impl<'a> Clone for SimpleErrorReport<'a>
impl<'a> Clone for SimpleErrorReport<'a>
Source§fn clone(&self) -> SimpleErrorReport<'a>
fn clone(&self) -> SimpleErrorReport<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for SimpleErrorReport<'a>
impl<'a> Debug for SimpleErrorReport<'a>
Source§impl<'a> SubmitErrorReport<'a> for SimpleErrorReport<'a>
impl<'a> SubmitErrorReport<'a> for SimpleErrorReport<'a>
Source§fn new(error: &'a ErrorReport) -> Self
fn new(error: &'a ErrorReport) -> Self
Create a new report wrapper from an error report reference.
Source§fn get_error_report(&self) -> &ErrorReport
fn get_error_report(&self) -> &ErrorReport
Return the
ErrorReport containing the error stack.Source§fn create_message(&self) -> Result<String, ErrorReport>
fn create_message(&self) -> Result<String, ErrorReport>
Create the full user-facing error message with report instructions.
Source§fn create_bug_report(&self) -> Result<String, ErrorReport>
fn create_bug_report(&self) -> Result<String, ErrorReport>
Create the bug report body text (same content as the URL submission).
Source§fn create_submit_url(&self) -> Result<Url, ErrorReport>
fn create_submit_url(&self) -> Result<Url, ErrorReport>
Create a URL that opens a pre-filled issue on the platform.
Source§fn create_submit_url_limited(
&self,
_max_length: usize,
) -> Result<Url, ErrorReport>
fn create_submit_url_limited( &self, _max_length: usize, ) -> Result<Url, ErrorReport>
Create a pre-filled issue URL, progressively removing detail to stay under
max_length.Source§fn check_existing_reports(&self) -> Result<Url, ErrorReport>
fn check_existing_reports(&self) -> Result<Url, ErrorReport>
Create a URL to search for existing reports with the same title.
Auto Trait Implementations§
impl<'a> Freeze for SimpleErrorReport<'a>
impl<'a> !RefUnwindSafe for SimpleErrorReport<'a>
impl<'a> Send for SimpleErrorReport<'a>
impl<'a> Sync for SimpleErrorReport<'a>
impl<'a> Unpin for SimpleErrorReport<'a>
impl<'a> !UnwindSafe for SimpleErrorReport<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more