Skip to content

Instantly share code, notes, and snippets.

@nabijaczleweli
Created September 16, 2015 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nabijaczleweli/b8eb21019f76351ea508 to your computer and use it in GitHub Desktop.
Save nabijaczleweli/b8eb21019f76351ea508 to your computer and use it in GitHub Desktop.
10/10 error handling
if(const auto sys = envvar_or({"OS"}, nullptr))
return sys;
throw runtime_error("the world is on fire"); // Something's *REALLY* wrong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment