Skip to main content

SubmitErrorReport

Trait SubmitErrorReport 

Source
pub trait SubmitErrorReport<'a> {
    // Required methods
    fn new(error: &'a ErrorReport) -> Self
       where Self: Sized;
    fn get_error_report(&self) -> &ErrorReport;
    fn get_title(&self) -> String;
    fn create_message(&self) -> Result<String, ErrorReport>;
    fn create_bug_report(&self) -> Result<String, ErrorReport>;
    fn create_submit_url(&self) -> Result<Url, ErrorReport>;
    fn create_submit_url_limited(
        &self,
        max_length: usize,
    ) -> Result<Url, ErrorReport>;
    fn check_existing_reports(&self) -> Result<Url, ErrorReport>;
    fn validate_settings(&self) -> Result<(), ErrorReport>;

    // Provided method
    fn truncate_string(text: String, limit: usize) -> String
       where Self: Sized { ... }
}
Expand description

Trait for converting an ErrorReport into a submittable issue report.

Implement this trait to add support for a new issue tracking platform. See GitLabErrorReport for the built-in GitLab implementation.

Required Methods§

Source

fn new(error: &'a ErrorReport) -> Self
where Self: Sized,

Create a new report wrapper from an error report reference.

Source

fn get_error_report(&self) -> &ErrorReport

Return the ErrorReport containing the error stack.

Source

fn get_title(&self) -> String

Return the title of the error.

Source

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>

Create the bug report body text (same content as the URL submission).

Source

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>

Create a pre-filled issue URL, progressively removing detail to stay under max_length.

Source

fn check_existing_reports(&self) -> Result<Url, ErrorReport>

Create a URL to search for existing reports with the same title.

Source

fn validate_settings(&self) -> Result<(), ErrorReport>

Validate that required global settings have been configured.

Called by setup_panic! in debug builds to catch missing configuration early.

Provided Methods§

Source

fn truncate_string(text: String, limit: usize) -> String
where Self: Sized,

Truncate a string to the given limit, respecting character boundaries.

Implementors§