Catch `Error`, not `BaseError` in `ValuePrinter`

`BaseError` includes `Interrupt`. We probably don't want the value
printer to tell you you pressed Ctrl-C while it was working.
This commit is contained in:
Rebecca Turner 2024-02-03 19:18:42 -08:00
parent 49cf090cb2
commit a7927abdc1
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -255,7 +255,7 @@ private:
output << "»";
if (options.ansiColors)
output << ANSI_NORMAL;
} catch (BaseError & e) {
} catch (Error & e) {
printError_(e);
}
}
@ -405,7 +405,7 @@ private:
output << ANSI_NORMAL;
}
void printError_(BaseError & e)
void printError_(Error & e)
{
if (options.ansiColors)
output << ANSI_RED;
@ -422,7 +422,7 @@ private:
if (options.force) {
try {
state.forceValue(v, v.determinePos(noPos));
} catch (BaseError & e) {
} catch (Error & e) {
printError_(e);
return;
}