Skip to content
Snippets Groups Projects
Commit 1c50c5ed authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

better fix, as the error happens before database access

parent e550ccb0
Branches
Tags
No related merge requests found
...@@ -108,28 +108,28 @@ foreach my $id (keys %{$configuration->{federations}}) { ...@@ -108,28 +108,28 @@ foreach my $id (keys %{$configuration->{federations}}) {
); );
$entity->update(); $entity->update();
} else { } else {
$entity = AccountManager::Entity->new( eval {
db => $db, $entity = AccountManager::Entity->new(
type => $entry->{type}, db => $db,
entityid => $entry->{entityid}, type => $entry->{type},
display_name => $entry->{display_name}, entityid => $entry->{entityid},
information_url => $entry->{information_url}, display_name => $entry->{display_name},
organization_url => $entry->{organization_url}, information_url => $entry->{information_url},
); organization_url => $entry->{organization_url},
if ($entry->{contacts}) { );
my @contacts = if ($entry->{contacts}) {
my @contacts =
uniq uniq
grep { $_ } grep { $_ }
map { $_->{EmailAddress} } map { $_->{EmailAddress} }
@{$entry->{contacts}}; @{$entry->{contacts}};
$entity->contacts(@contacts); $entity->contacts(@contacts);
} }
$entity->federations($id); $entity->federations($id);
eval {
$entity->save(); $entity->save();
}; };
if ($EVAL_ERROR) { if ($EVAL_ERROR) {
warn "error while saving entity $entry->{entityid}: $EVAL_ERROR"; warn "error while processing entity $entry->{entityid}: $EVAL_ERROR";
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment