Skip to content

Commit

Permalink
Better error messages for pruneBranch count
Browse files Browse the repository at this point in the history
  • Loading branch information
grunt-lucas committed Sep 10, 2023
1 parent f71d068 commit 40e2ee0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/palette_assignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ AssignResult assignDepthFirst(PtContext &ctx, AssignState &state, std::vector<Co
}
else if (ctx.compilerConfig.pruneCount > 0) {
if (ctx.compilerConfig.pruneCount >= stopLimit) {
// FIXME : proper error message
throw std::runtime_error{"pruneCount pruned every branch"};
fatalerror(ctx.err, ctx.compilerSrcPaths, ctx.compilerConfig.mode,
fmt::format("'prune-branches' parameter '{}' pruned every branch",
fmt::styled(ctx.compilerConfig.pruneCount, fmt::emphasis::bold)));
}
stopLimit -= ctx.compilerConfig.pruneCount;
}
Expand Down Expand Up @@ -202,8 +203,9 @@ AssignResult assignBreadthFirst(PtContext &ctx, AssignState &initialState, std::
}
else if (ctx.compilerConfig.pruneCount > 0) {
if (ctx.compilerConfig.pruneCount >= stopLimit) {
// FIXME : proper error message
throw std::runtime_error{"pruneCount pruned every branch"};
fatalerror(ctx.err, ctx.compilerSrcPaths, ctx.compilerConfig.mode,
fmt::format("'prune-branches' parameter '{}' pruned every branch",
fmt::styled(ctx.compilerConfig.pruneCount, fmt::emphasis::bold)));
}
stopLimit -= ctx.compilerConfig.pruneCount;
}
Expand Down

0 comments on commit 40e2ee0

Please sign in to comment.