mirror of
https://github.com/Dummi26/mers.git
synced 2026-01-19 16:24:42 +01:00
add support for custom theming in mers errors
this also includes support for the NoTheme, a theme which doesn't add any color to mers' output. If you compile mers with --no-default-features, the `colored` dependency will disappear and mers_lib will fall back to NoTheme.
This commit is contained in:
@@ -7,7 +7,7 @@ use std::{
|
||||
|
||||
use crate::{
|
||||
data::{self, Data, Type},
|
||||
errors::{error_colors, CheckError, SourceRange},
|
||||
errors::{CheckError, EColor, SourceRange},
|
||||
info,
|
||||
};
|
||||
|
||||
@@ -98,10 +98,10 @@ pub trait MersStatement: Debug + Send + Sync {
|
||||
if let Some(cutoff) = info.global.limit_runtime {
|
||||
if Instant::now() >= cutoff {
|
||||
return Err(CheckError::new()
|
||||
.msg("maximum runtime exceeded".to_owned())
|
||||
.msg_str("maximum runtime exceeded".to_owned())
|
||||
.src(vec![(
|
||||
self.source_range(),
|
||||
Some(error_colors::MaximumRuntimeExceeded),
|
||||
Some(EColor::MaximumRuntimeExceeded),
|
||||
)]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user