Make sure we're revoking API keys before throwing an exception

This commit is contained in:
Bradley Schofield 2024-02-24 14:43:33 +00:00
parent d13cb6f949
commit 3f603995f5

View file

@ -340,6 +340,9 @@ class Migrations extends Action
$migrationDocument->setAttribute('errors', $errorMessages);
}
} finally {
if ($tempAPIKey) {
$this->removeAPIKey($tempAPIKey);
}
if ($migrationDocument) {
$this->updateMigrationDocument($migrationDocument, $projectDocument);
@ -347,9 +350,6 @@ class Migrations extends Action
throw new Exception(implode("\n", $migrationDocument->getAttribute('errors', []));
}
}
if ($tempAPIKey) {
$this->removeAPIKey($tempAPIKey);
}
}
}
}