It wraps an error only if it's non-nil and aims to avoid some code dupplication on wrapping errors to callers