I wouldn't use the advice in this article. It's quite old and the stdlib now has support for new stuff via error wrapping.