Model errors are ubiquitous in practical history matching problems. A common approach in the literature to accounting for model errors is to treat them as random variables following certain presumed distributions. While such a treatment renders algorithmic convenience, its underpinning assumptions are often invalid. In this work, we adopt an alternative approach, and treat model-error characterization as a functional approximation problem, which can be solved using a generic machine learning method. We then integrate the proposed model-error characterization approach into an ensemble-based history matching framework, and show that, with very minor modifications, existing ensemble-based history matching algorithms can be readily deployed to solve the history matching problem in the presence of model errors.To demonstrate the efficacy of the integrated history matching framework, we apply it to account for potential model errors of a rock physics model in 4D seismic history matching applied to the full Norne benchmark case. The numerical results indicate that the proposed model-error characterization approach helps improve the qualities of estimated reservoir models, and leads to more accurate forecasts of production data. This suggests that accounting for model errors from a perspective of machine learning serves as a viable way to deal with model imperfection in practical history matching problems.