public static function GetDocumentFromHistory($historyId, &$arErrors) { $arErrors = array(); try { $historyId = intval($historyId); if ($historyId <= 0) throw new CBPArgumentNullException("historyId"); return CBPHistoryService::GetById($historyId); } catch (Exception $e) { $arErrors[] = array( "code" => $e->getCode(), "message" => $e->getMessage(), "file" => $e->getFile()." [".$e->getLine()."]" ); } }