For brevity, the two checks should be combined (they do essentially the same thing). Make sure error codes are consistent and each matches with a unique error (you can add or remove codes as necessary).