Man caught with gun, charged