mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-09-19 15:14:34 +00:00
0.9.6.12 include stage and technical cause in visible error
This commit is contained in:
@@ -20,9 +20,13 @@ function bratonien_tools_nc_edit_json($status, array $payload)
|
|||||||
|
|
||||||
function bratonien_tools_nc_edit_fail($message, array $fields = array(), $stage = '', $detail = '')
|
function bratonien_tools_nc_edit_fail($message, array $fields = array(), $stage = '', $detail = '')
|
||||||
{
|
{
|
||||||
|
$visible = trim((string)$message);
|
||||||
|
if ($stage !== '') $visible = 'Bereich: '.$stage.' — '.$visible;
|
||||||
|
if ($detail !== '') $visible .= ' Technische Ursache: '.$detail;
|
||||||
|
|
||||||
bratonien_tools_nc_edit_json(422, array(
|
bratonien_tools_nc_edit_json(422, array(
|
||||||
'ok'=>false,
|
'ok'=>false,
|
||||||
'message'=>(string)$message,
|
'message'=>$visible,
|
||||||
'stage'=>(string)$stage,
|
'stage'=>(string)$stage,
|
||||||
'detail'=>(string)$detail,
|
'detail'=>(string)$detail,
|
||||||
'fields'=>array_values(array_unique($fields)),
|
'fields'=>array_values(array_unique($fields)),
|
||||||
@@ -278,11 +282,10 @@ catch (Throwable $e)
|
|||||||
$add('nc_connection_api_key_secret');
|
$add('nc_connection_api_key_secret');
|
||||||
}
|
}
|
||||||
|
|
||||||
bratonien_tools_nc_edit_json(422, array(
|
bratonien_tools_nc_edit_fail(
|
||||||
'ok'=>false,
|
$message,
|
||||||
'message'=>$message,
|
$fields,
|
||||||
'stage'=>$stage,
|
$stage,
|
||||||
'detail'=>'Interne Prüfung: '.get_class($e),
|
'Interne Prüfung: '.get_class($e)
|
||||||
'fields'=>$fields,
|
);
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user