Make sure the error exists before checking its code when appending to the slots file