BUG: Handle the case where status != 2

The local variable `message` wasn't being set in all cases, causing runtime errors.