This check is performed on an error returned by cotterpin, so why not use a check function from the same library? I'm also hesitant to wrap errors multiple times.