[Nix-dev] assertions / throwing an error-message

Mathijs Kwik mathijs at bluescreen303.nl
Sun Nov 18 18:36:16 CET 2012


On Sun, Nov 18, 2012 at 6:26 PM, Marc Weber <marco-oweber at gmx.de> wrote:
> You can builtins.trace a message, then cause failing assertion.
> AFAIK assertios show file, line. Thus its easy to lookup.
>
> Maybe it would be a use case for a soft throw behaving like a failed
> assertion - thus I'd not worry too much.

I've done something like that.

if !accepted then throw "msg" else assert accepted;

>
> Marc Weber


More information about the nix-dev mailing list