Ajout d'un test supplémentaire pour améliorer le rapport d'erreur
This commit is contained in:
parent
1d46250de9
commit
270af63abc
@ -34,10 +34,15 @@ function action_importer_emission_dist($arg = null) {
|
||||
$ogg_size = "";
|
||||
$mp3_size = "";
|
||||
try {
|
||||
$jsonContents = file_get_contents("https://forge.april.org/libreavous/lav-outils/raw/branch/master/podcasts/config/lav-".$code_emission.".json");
|
||||
$json = json_decode($jsonContents, true);
|
||||
if (!$json) {
|
||||
$erreurs[] = "JSON incorrect : https://forge.april.org/libreavous/lav-outils/raw/branch/master/podcasts/config/lav-".$code_emission.".json";
|
||||
$jsonUrl = "https://forge.april.org/libreavous/lav-outils/raw/branch/master/podcasts/config/lav-".$code_emission.".json";
|
||||
$jsonContents = file_get_contents($jsonUrl);
|
||||
if ($jsonContents === false) {
|
||||
$erreurs[] = "Erreur d'accès au fichier JSON :".$jsonUrl;
|
||||
} else {
|
||||
$json = json_decode($jsonContents, true);
|
||||
if (!$json) {
|
||||
$erreurs[] = "JSON incorrect :".$jsonUrl;
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$erreurs[] = $e->getMessage();
|
||||
|
@ -99,10 +99,15 @@ function libreavous_import_run($id_article) {
|
||||
$ogg_size = "";
|
||||
$mp3_size = "";
|
||||
try {
|
||||
$jsonContents = file_get_contents("https://forge.april.org/libreavous/lav-outils/raw/branch/master/podcasts/config/lav-".$code_emission.".json");
|
||||
$json = json_decode($jsonContents, true);
|
||||
if (!$json) {
|
||||
$erreurs[] = "JSON incorrect : https://forge.april.org/libreavous/lav-outils/raw/branch/master/podcasts/config/lav-".$code_emission.".json";
|
||||
$jsonUrl = "https://forge.april.org/libreavous/lav-outils/raw/branch/master/podcasts/config/lav-".$code_emission.".json";
|
||||
$jsonContents = file_get_contents($jsonUrl);
|
||||
if ($jsonContents === false) {
|
||||
$erreurs[] = "Erreur d'accès au fichier JSON :".$jsonUrl;
|
||||
} else {
|
||||
$json = json_decode($jsonContents, true);
|
||||
if (!$json) {
|
||||
$erreurs[] = "JSON incorrect :".$jsonUrl;
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$erreurs[] = $e->getMessage();
|
||||
|
Loading…
Reference in New Issue
Block a user