mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
replace panic! with internal_error! in compiler modules
This commit is contained in:
parent
ba1f8ffe5f
commit
e5eb5717ea
11 changed files with 60 additions and 36 deletions
|
@ -26,6 +26,7 @@ roc_module = { path = "../module" }
|
|||
roc_packaging = { path = "../../packaging" }
|
||||
roc_reporting = { path = "../../reporting" }
|
||||
roc_target = { path = "../roc_target" }
|
||||
roc_error_macros = { path = "../../error_macros" }
|
||||
|
||||
bumpalo.workspace = true
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ use std::path::{Path, PathBuf};
|
|||
|
||||
#[cfg(not(windows))]
|
||||
use bumpalo::Bump;
|
||||
use roc_error_macros::internal_error;
|
||||
use roc_module::symbol::ModuleId;
|
||||
|
||||
const SKIP_SUBS_CACHE: bool = {
|
||||
|
@ -93,10 +94,10 @@ fn write_types_for_module_real(module_id: ModuleId, filename: &str, output_path:
|
|||
let mut module = match res_module {
|
||||
Ok(v) => v,
|
||||
Err(LoadingProblem::FormattedReport(report)) => {
|
||||
panic!("{}", report);
|
||||
internal_error!("{}", report);
|
||||
}
|
||||
Err(other) => {
|
||||
panic!("build_file failed with error:\n{:?}", other);
|
||||
internal_error!("build_file failed with error:\n{:?}", other);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -109,7 +110,7 @@ fn write_types_for_module_real(module_id: ModuleId, filename: &str, output_path:
|
|||
);
|
||||
|
||||
if problems.errors + problems.warnings > 0 {
|
||||
panic!("Problems were found! Refusing to build cached subs.");
|
||||
internal_error!("Problems were found! Refusing to build cached subs.");
|
||||
}
|
||||
|
||||
let subs = module.solved.into_inner();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue