Skip to main content

luaur_analysis/methods/
dcr_logger_capture_generation_error.rs

1use crate::functions::to_string_error::to_string_type_error;
2use crate::records::dcr_logger::DcrLogger;
3use crate::records::error_snapshot::ErrorSnapshot;
4use crate::records::type_error::TypeError;
5use alloc::string::String;
6
7impl DcrLogger {
8    pub fn capture_generation_error(&mut self, error: &TypeError) {
9        let stringified_error: String = to_string_type_error(error);
10        self.generation_log.errors.push(ErrorSnapshot {
11            message: stringified_error,
12            location: error.location,
13        });
14    }
15}