Move this if above the if(code <= 0), and make it an if(code < 0) ...
One fewer conditional checks, and less lookup for the most common case. Also avoids nested if's when they can easily be flat.