diff --git a/install/helioviewer/jp2parser.py b/install/helioviewer/jp2parser.py index 78244b79..135b5281 100644 --- a/install/helioviewer/jp2parser.py +++ b/install/helioviewer/jp2parser.py @@ -9,7 +9,7 @@ from astropy.time import Time from sunpy.map import Map, GenericMap from sunpy.util.xml import xml_to_dict -from sunpy.io._header import FileHeader +from sunpy.io.header import FileHeader from sunpy.map.mapbase import MapMetaValidationError from glymur import Jp2k from sunpy.util.xml import xml_to_dict diff --git a/src/Database/ImgIndex.php b/src/Database/ImgIndex.php index 66852444..c5acefdb 100644 --- a/src/Database/ImgIndex.php +++ b/src/Database/ImgIndex.php @@ -13,6 +13,8 @@ * @link https://github.com/Helioviewer-Project/ */ +use Helioviewer\Api\Sentry\Sentry; + class Database_ImgIndex { private $_dbConnection; @@ -139,6 +141,7 @@ public function getMovieInformation($movieId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -183,6 +186,7 @@ public function storeMovieProperties($movieId, $startDate, $endDate, $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -220,6 +224,7 @@ public function finishedBuildingMovieFrames($movieId, $buildTimeStart, $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -252,6 +257,7 @@ public function markMovieAsProcessing($movieId, $format) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -288,6 +294,7 @@ public function markMovieAsFinished($movieId, $format, $procTime) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -317,6 +324,7 @@ public function markMovieAsInvalid($movieId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -344,6 +352,7 @@ public function getScreenshot($screenshotId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -370,6 +379,7 @@ public function getImageInformation($dataId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -430,16 +440,14 @@ public function getDataFromDatabase($date, $sourceId) { FROM data WHERE ".$this->getDatasourceIDsString($sourceId)." AND date = (SELECT date - FROM data " . $this->_forceIndex($sourceId) . " - WHERE ".$this->getDatasourceIDsString($sourceId)." + FROM data WHERE ".$this->getDatasourceIDsString($sourceId)." AND date < '%s' ORDER BY date DESC LIMIT 1)) UNION ALL (SELECT id, sourceId, filepath, filename, date FROM data WHERE ".$this->getDatasourceIDsString($sourceId)." AND date = (SELECT date - FROM data " . $this->_forceIndex($sourceId) . " - WHERE ".$this->getDatasourceIDsString($sourceId)." + FROM data WHERE ".$this->getDatasourceIDsString($sourceId)." AND date >= '%s' ORDER BY date ASC LIMIT 1)) ) t ORDER BY @@ -449,10 +457,12 @@ public function getDataFromDatabase($date, $sourceId) { $this->_dbConnection->link->real_escape_string($datestr), $this->_dbConnection->link->real_escape_string($datestr) ); + try { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -608,6 +618,7 @@ public function getClosestDataBeforeDate($date, $sourceId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); error_log("Failed to get closest image before date: " . $e->getMessage()); return false; } @@ -654,6 +665,7 @@ public function getClosestDataAfterDate($date, $sourceId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -685,6 +697,7 @@ private function _getDataSourceName($sourceId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -783,6 +796,7 @@ public function getDataCount($start, $end, $sourceId, $switchSources = false) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -948,6 +962,7 @@ public function getDataMidPoint($start, $end, $mid, $sourceId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1037,6 +1052,7 @@ public function getDatasourceInformationFromSourceId($sourceId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1106,6 +1122,7 @@ public function getDatasourceInformationFromNames($property_array) { catch (Exception $e) { error_log(print_r($property_array, true)); error_log($e->getMessage()); + Sentry::capture($e); return false; } @@ -1168,6 +1185,7 @@ public function getDataSourceLabels($property_array) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1214,10 +1232,12 @@ public function getSourceId($property_array) { try { $result = $this->_dbConnection->query($sql); if ( $result->num_rows != 1 ) { + Sentry::capture($e); return false; } } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1242,6 +1262,7 @@ public function getOldestData($sourceId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1274,6 +1295,7 @@ public function getNewestData($sourceId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1304,6 +1326,7 @@ public function getObservatoryForInstrument(string $instrument) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1339,6 +1362,7 @@ public function getDataSourcesByInstrument() { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1579,6 +1603,7 @@ public function getDataFilePathFromId($dataId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } @@ -1605,6 +1630,7 @@ public function getScreenshotMetadata($screenshotId) { $result = $this->_dbConnection->query($sql); } catch (Exception $e) { + Sentry::capture($e); return false; } diff --git a/src/Job/MovieBuilder.php b/src/Job/MovieBuilder.php index c7f4b434..4a914d4a 100644 --- a/src/Job/MovieBuilder.php +++ b/src/Job/MovieBuilder.php @@ -1,5 +1,4 @@