Accurate and efficient simulation of the hydraulic shock phenomenon in pipeline systems is of paramount importance. Even though the conservation-law formulation of the governing equations is here strongly advocated, the nonconservative form is still frequently used. This also concerns its mathematical conservative form. We investigated the numerical consequences of using the compressible gas flow model in the latter form while simulating a hydraulic shock. In this context, we also solved two Riemann problems. For the investigation, we used the third-, fifth- and seventh-order accurate weighted essentially non-oscillatory (WENO) scheme along with the Lax–Friedrichs solver at the cell interfaces. Both the classical finite volume WENO scheme and its modification WENO–Z have been implemented. A procedure based on the method of manufactured solutions has been developed to verify whether the numerical code solved correctly the hyperbolic set of equations. We demonstrated that the solutions of the conservative and nonconservative formulations are similar if we have smooth variations in the solution domain. The convective inertia term in the momentum equation should not be ignored. In the presence of shocks, differences in oscillating behavior and slope steepness near the discontinuities were observed. For the hydraulic shock problem, spurious oscillations appeared while using the nonconservative formulation in combination with the WENO–Z reconstruction.