php8 visualconsoles review, warning! class and object missunderstanding here...

This commit is contained in:
fbsanchez 2022-01-12 20:46:46 +01:00
parent a58c6862e1
commit 7f574e1132
1 changed files with 11 additions and 1 deletions

View File

@ -132,6 +132,11 @@ if ($getVisualConsole === true) {
$item = VisualConsole::getItemFromDB($itemId);
} catch (Throwable $e) {
// Bad params.
echo $e->getMessage();
if (__DEBUG === 1) {
echo ' at '.$e->getFile().':'.$e->getLine();
}
http_response_code(400);
return;
}
@ -209,6 +214,11 @@ if ($getVisualConsole === true) {
$item = VisualConsole::getItemFromDB($result);
} catch (Throwable $e) {
// Bad params.
echo $e->getMessage();
if (__DEBUG === 1) {
echo ' at '.$e->getFile().':'.$e->getLine();
}
http_response_code(400);
return;
}
@ -247,7 +257,7 @@ if ($getVisualConsole === true) {
}
$data = get_parameter('data');
$result = $item::delete($itemId);
$result = $item->delete($itemId);
echo $result;
return;
} else if ($copyVisualConsoleItem === true) {