chg: [localtTools:connectionRequest] Provide more info on exception

cli-modification-summary
Sami Mokaddem 2022-01-24 16:12:46 +01:00 committed by Sami Mokaddem
parent 7d227a4387
commit 4f8b663b87
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 11 additions and 2 deletions

View File

@ -304,7 +304,17 @@ class LocalToolsController extends AppController
throw new MethodNotAllowedException(__('No local tool ID supplied.'));
}
$params['local_tool_id'] = $postParams['local_tool_id'];
$encodingResult = $this->LocalTools->encodeConnection($params);
try {
$encodingResult = $this->LocalTools->encodeConnection($params);
} catch (\Exception $e) {
$encodingResult = [
'inboxResult' => [
'success' => false,
'message' => __('Error while trying to encode connection'),
'errors' => [$e->getMessage()],
],
];
}
$inboxResult = $encodingResult['inboxResult'];
if ($inboxResult['success']) {
if ($this->ParamHandler->isRest()) {

View File

@ -29,4 +29,3 @@
]
]);
?>
</div>