Fix for FingerprintPostController
This commit is contained in:
parent
b0f2991346
commit
3cb02a12f1
|
@ -17,6 +17,7 @@ final class FingerprintPostController extends AbstractController
|
||||||
$db = new MySqlDatabase();
|
$db = new MySqlDatabase();
|
||||||
$json = json_decode($this->requestBody);
|
$json = json_decode($this->requestBody);
|
||||||
$fingerprint = new Fingerprint(null, $db);
|
$fingerprint = new Fingerprint(null, $db);
|
||||||
|
$this->response = new ApiJsonResponse();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$fingerprint->setFingerprint($json->fingerprint);
|
$fingerprint->setFingerprint($json->fingerprint);
|
||||||
|
@ -36,13 +37,10 @@ final class FingerprintPostController extends AbstractController
|
||||||
|
|
||||||
$this->response->setParameter('fingerprintId', $fingerprint->getFingerprintId());
|
$this->response->setParameter('fingerprintId', $fingerprint->getFingerprintId());
|
||||||
} catch (QrCodeException $e) {
|
} catch (QrCodeException $e) {
|
||||||
$db->rollback();
|
$this->response->setStatus(ServerStatus::INTERNAL_ERROR);
|
||||||
|
|
||||||
$this->response->setParameter('success', false);
|
$this->response->setParameter('success', false);
|
||||||
$this->response->setStatus(ServerStatus::INTERNAL_ERROR);
|
$this->response->setMessage('An error occured during QR code creation!');
|
||||||
$this->response->setMessage('An error occured during qr code creation!');
|
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
$db->rollback();
|
|
||||||
$this->catchDatabaseException($e->getMessage(), $json);
|
$this->catchDatabaseException($e->getMessage(), $json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue