awslabs / palace

3D finite element solver for computational electromagnetics
https://awslabs.github.io/palace/dev
Apache License 2.0
237 stars 49 forks source link

Fix cryptic error for empty arrays in JSON config file #214

Closed sebastiangrimberg closed 6 months ago

sebastiangrimberg commented 6 months ago

Previously, an (incorrect) configuration file array specified as "Attributes": [] would lead to an error like:

Verification failed: (ec == std::errc()) is false:
 --> Invalid integer conversion in range expansion!
 ... in function: palace::{anonymous}::PreprocessFile(const char*)::<lambda(std::string_view)>
 ... in file: /apps/palace/palace/palace/utils/iodata.cpp:77

This case is now handled and checked for in the JSON Schema during --dry-run.