The truncation error in the application of sampling series to electromagnetic problems