Error handling code on page 328


#1

The error handling code snippet on page 328 has a subtle error:

if (!success) {
     if (e) {
          ... do things...
          return nil;
    }
}

should be

if (!success) {
     if (e) {
          ... do things...
    }
    return nil;
}

The given code will not necessarily return nil on failure if the user did not pass in an error code address.

Oh… On page 325 this challenge is mentioned to be the last of the book, but one more challenge is in the appendix.