Or getting the cap could have been coincidental to the leak happening, but that's a bit of a stretch.
If you start the car with the cap off, or fuel it while running, you might be getting the message for that reason.