-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error messages for bad maker calls (#294)
This covers situations where somebody calls a `QuantityMaker`, or `QuantityPointMaker`, on a value that isn't a valid rep. (One of the most common use cases is when the value is _already_ a core Au type, a `Quantity` or `QuantityMaker`, and the call is redundant. The first approach is a blanket approach: we start enforcing the "valid rep" definition that we had previously added. This already makes the error messages a lot nicer and shorter. We then go further for the most common use case of redundant maker calls. By adding templated overloads to each maker for `Quantity` and `QuantityPoint`, we can directly tell users what they did wrong. In order to implement these overloads, we needed an `AlwaysFalse` utliity, which we added along with unit tests. Helps #288. We will follow up to close this out by updating the troubleshooting guide. --------- Co-authored-by: Geoffrey Viola <[email protected]>
- Loading branch information
1 parent
b295267
commit 3a4426a
Showing
6 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters