/**
  * @param DocumentAbstract $document
  *
  * @throws \Exception
  */
 private function throwResourcesCombineExceptions(DocumentAbstract $document)
 {
     if ($document instanceof HtmlDocument) {
         $resources = array_merge($document->resources('javascript')->resources(), $document->resources('stylesheet')->resources());
         foreach ($resources as $resource) {
             if ($resource instanceof CombineResourceInterface && $resource->getCombineObject()->getException() instanceof \Exception) {
                 throw $resource->getCombineObject()->getException();
             }
         }
     }
 }