fix departaimant migration

This commit is contained in:
Jérémy Munsch 2021-03-29 14:44:08 +02:00
parent fd4f6e9fa1
commit fcbbe9b432

View file

@ -97,7 +97,11 @@ class MigrateDepartaimants extends LeGaulois2016Migration
$depValue = $oldDpCache[$dept->dId]->dept_code;
$depValue = ($depValue == '971' || $depValue == '972') ?
DepartaimantVintage::guadeloupeMartinique()->value : $depValue;
$departaimant = DepartaimantVintage::make($depValue);
try {
$departaimant = DepartaimantVintage::make($depValue);
} catch (BadMethodCallException $e) {
dump(sprintf('Unkonwn value %s for collection vintage', $depValue));
}
break;
default:
throw new Exception(sprintf(