Use type alias for error.

This commit is contained in:
Stephen Chung
2021-12-27 12:27:31 +08:00
parent e7ca3f41dd
commit 05d4c81e7a
29 changed files with 293 additions and 378 deletions

View File

@@ -509,7 +509,7 @@ mod string_functions {
// Check if string will be over max size limit
#[cfg(not(feature = "unchecked"))]
if _ctx.engine().max_string_size() > 0 && len as usize > _ctx.engine().max_string_size() {
return Err(crate::EvalAltResult::ErrorDataTooLarge(
return Err(crate::ERR::ErrorDataTooLarge(
"Length of string".to_string(),
crate::Position::NONE,
)
@@ -528,7 +528,7 @@ mod string_functions {
#[cfg(not(feature = "unchecked"))]
if _ctx.engine().max_string_size() > 0 && string.len() > _ctx.engine().max_string_size()
{
return Err(crate::EvalAltResult::ErrorDataTooLarge(
return Err(crate::ERR::ErrorDataTooLarge(
"Length of string".to_string(),
crate::Position::NONE,
)
@@ -553,7 +553,7 @@ mod string_functions {
// Check if string will be over max size limit
#[cfg(not(feature = "unchecked"))]
if _ctx.engine().max_string_size() > 0 && len as usize > _ctx.engine().max_string_size() {
return Err(crate::EvalAltResult::ErrorDataTooLarge(
return Err(crate::ERR::ErrorDataTooLarge(
"Length of string".to_string(),
crate::Position::NONE,
)
@@ -579,7 +579,7 @@ mod string_functions {
#[cfg(not(feature = "unchecked"))]
if _ctx.engine().max_string_size() > 0 && string.len() > _ctx.engine().max_string_size()
{
return Err(crate::EvalAltResult::ErrorDataTooLarge(
return Err(crate::ERR::ErrorDataTooLarge(
"Length of string".to_string(),
crate::Position::NONE,
)