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

pull/93/head
Sami Mokaddem 2022-01-24 16:12:46 +01:00
parent 5cac62a9b8
commit 7535cd2bdf
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>