[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/zero_columns ced5a90 4/7: Suppress a misleading
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/zero_columns ced5a90 4/7: Suppress a misleading error message when no columns are requested |
Date: |
Mon, 6 May 2019 07:21:22 -0400 (EDT) |
branch: odd/zero_columns
commit ced5a90cde731975907f52a9eecc88a60f9cacbc
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Suppress a misleading error message when no columns are requested
The error message
"Not enough room for even the first column."
suggests that at least one column was requested and the first is too
wide. If no columns were requested, then there is no first column
(so the error message was misleading), and all (zero) columns should
fit in a table (so throwing an exception was wrong).
---
report_table.cpp | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/report_table.cpp b/report_table.cpp
index 0972569..03dfd40 100644
--- a/report_table.cpp
+++ b/report_table.cpp
@@ -127,21 +127,9 @@ std::vector<int> set_column_widths
else break;
}
- if(0 == n_columns_to_show)
+ if(0 == n_columns_to_show && 0 != cardinality)
{
- warning()
- << "BIG TROUBLE\n"
- << max_table_width << " max_table_width\n"
- << desired_margin << " desired_margin\n"
- << minimum_margin << " minimum_margin\n"
- << cardinality << " cardinality\n"
-// Indexing [0] would crash:
-// << all_columns[0].col_width() << " all_columns[0].col_width()\n"
- << data_width << " data_width\n"
- << LMI_FLUSH
- ;
- warning() << "Not enough room for even the first column." << LMI_FLUSH;
-// alarum() << "Not enough room for even the first column." << LMI_FLUSH;
+ alarum() << "Not enough room for even the first column." << LMI_FLUSH;
}
// These two are boolean, but vector<bool> isn't a Container.
- [lmi-commits] [lmi] odd/zero_columns updated (f5a1790 -> e5b9a61), Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns b503329 1/7: Remove lines that served only to locate failures, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns 8e2dd5d 2/7: Don't circumvent an assertion that does not fail, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns 7c26437 3/7: Rewrite a couple of lines for clarity, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns e5b9a61 7/7: Remove an unnecessary early-return statement, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns 29925fd 5/7: Explain a seeming anomaly, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns 08a994b 6/7: Comment early-return statement that are not in master, Greg Chicares, 2019/05/06
- [lmi-commits] [lmi] odd/zero_columns ced5a90 4/7: Suppress a misleading error message when no columns are requested,
Greg Chicares <=