From 379681157172658825e4b647eec9477dd5d8f05d Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 8 Mar 2024 06:29:52 +0100 Subject: [PATCH] Merge pull request #9927 from 9999years/catch-error-in-value-printer Catch `Error`, not `BaseError` in `ValuePrinter` BaseError includes Interrupt. We probably don't want the value printer to tell you Ctrl-C was pressed while it was printing. (cherry picked from commit c291d2d8dda38aa88b004e2ed05b28653c07e342) Change-Id: I70b105bfb2f52a8f345ae0281d12f022aa36b14e --- src/libexpr/print.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index c04278a0e..8b45475d8 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -253,7 +253,7 @@ private: output << "ยป"; if (options.ansiColors) output << ANSI_NORMAL; - } catch (BaseError & e) { + } catch (Error & e) { printError_(e); } } @@ -403,7 +403,7 @@ private: output << ANSI_NORMAL; } - void printError_(BaseError & e) + void printError_(Error & e) { if (options.ansiColors) output << ANSI_RED; @@ -420,7 +420,7 @@ private: if (options.force) { try { state.forceValue(v, v.determinePos(noPos)); - } catch (BaseError & e) { + } catch (Error & e) { printError_(e); return; }