Return early from try block

This commit is contained in:
David Bomba 2021-05-10 14:11:26 +10:00
parent a272956df2
commit e63b3cb76a

View File

@ -176,12 +176,15 @@ class StepsController extends BaseController
); );
} }
try {
$migrationData = $this->generateMigrationData($request->all()); $migrationData = $this->generateMigrationData($request->all());
$completeService = (new CompleteService(session('MIGRATION_ACCOUNT_TOKEN'))) $completeService = (new CompleteService(session('MIGRATION_ACCOUNT_TOKEN')))
->data($migrationData) ->data($migrationData)
->endpoint(session('MIGRATION_ENDPOINT')) ->endpoint(session('MIGRATION_ENDPOINT'))
->start(); ->start();
}
finally {
if ($completeService->isSuccessful()) { if ($completeService->isSuccessful()) {
return view('migration.completed'); return view('migration.completed');
@ -189,6 +192,7 @@ class StepsController extends BaseController
return view('migration.completed', ['customMessage' => $completeService->getErrors()[0]]); return view('migration.completed', ['customMessage' => $completeService->getErrors()[0]]);
} }
}
public function completed() public function completed()
{ {