:help :v will tell you:
:[range]v[global]/{pattern}/[cmd] Same as :g!.
Where:
:[range]g[lobal]!/{pattern}/[cmd] Execute the Ex command [cmd] (default ":p") on the lines within [range] where {pattern} does NOT match.
So :v/error/d will delete all lines that don't contain the string "error".