mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Catch HTTP 442 unprocessable content response
This commit is contained in:
parent
75bb3e4a34
commit
a6fdb63dd2
@ -17,13 +17,12 @@ if (isset($plugin_uri) && isset($plugin_version)) {
|
|||||||
try {
|
try {
|
||||||
$return = $pluginInstaller->installPlugin($archiveUrl);
|
$return = $pluginInstaller->installPlugin($archiveUrl);
|
||||||
echo json_encode($return);
|
echo json_encode($return);
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
http_response_code(500);
|
http_response_code(422); // Unprocessable Content
|
||||||
echo json_encode(['error' => $e->getMessage()]);
|
echo json_encode(['error' => $e->getMessage()]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
http_response_code(400);
|
http_response_code(400); // Bad Request
|
||||||
echo json_encode(['error' => 'Plugin URI and version are required']);
|
echo json_encode(['error' => 'Plugin URI and version are required']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user