Commit 6956699
authored
fix(cdk/table): show a real error message instead of a crash when a table column is missing (#33698)
Before: if a <cdk-table> row used a column that wasn't defined, the app
would crash in production with a confusing error like "Cannot read
properties of undefined (reading 'headerCell')" — no mention of which
column was the problem. This message only showed up in dev mode; in
production you just got a raw, useless crash.
Now: the table always throws a clear error like `Could not find
column with id "column_a".`, in both dev and production, so it's
obvious what went wrong and which column to fix.
Added a test that forces production mode and checks the table gives
the helpful error instead of crashing.1 parent 4358fb0 commit 6956699
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1287 | 1287 | | |
1288 | 1288 | | |
1289 | 1289 | | |
1290 | | - | |
| 1290 | + | |
1291 | 1291 | | |
1292 | 1292 | | |
1293 | | - | |
| 1293 | + | |
1294 | 1294 | | |
1295 | 1295 | | |
1296 | 1296 | | |
| |||
1415 | 1415 | | |
1416 | 1416 | | |
1417 | 1417 | | |
1418 | | - | |
| 1418 | + | |
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
1422 | | - | |
| 1422 | + | |
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
| |||
0 commit comments