We abstract the essential aspects of network-error detecting and correcting codes to arrive at the definitions of matroidal error detecting networks and matroidal error correcting networks. An acyclic network (with arbitrary sink demands) is then shown to possess a scalar linear error detecting (correcting) network code if and only if it is a matroidal error detecting (correcting) network associated with a representable matroid. Therefore, constructing such network-error correcting and detecting codes implies the construction of certain representable matroids that satisfy some special conditions, and vice versa. We then present algorithms which enable the construction of matroidal error detecting and correcting networks with a specified capability of network-error correction. Using these construction algorithms, a large class of hitherto unknown scalar linearly solvable networks with multisource multicast and multiple-unicast network-error correcting codes is made available for theoretical use and practical implementation, with parameters such as number of information symbols, number of sinks, number of coding nodes, error correcting capability, etc. being arbitrary but for computing power (for the execution of the algorithms). The complexity of the construction of these networks is shown to be comparable to the complexity of existing algorithms that design multicast scalar linear network-error correcting codes. Finally we also show that linear network coding is not sufficient for the general network-error detection problem with arbitrary demands. In particular, for the same number of network-errors, we show a network for which there is a nonlinear network-error detecting code satisfying the demands at the sinks, while there are no linear network-error detecting codes that do the same.