Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release_3_8] Display a generic error in case of action failure to the end-user #5112

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lizmap/modules/action/controllers/service.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function index()
// Redirect if the user has no right to access this repository
if (!$lizmapProject->checkAcl()) {
$errors = array(
'title' => 'Access forbiden',
'title' => 'Access forbidden',
'detail' => jLocale::get('view~default.repository.access.denied'),
);

Expand Down Expand Up @@ -201,10 +201,14 @@ public function index()
$data = json_decode($r->data);
}
} catch (Exception $e) {
jLog::log('Error in project '.$repository.'/'.$project.', layer '.$layerId.', while running the query : '.$sql, 'lizmapadmin');
jLog::log(
'Error in project '.$repository.'/'.$project.', layer '.$layerId.', '.
'while running the action with the PostgreSQL query : '.$sql.' → '.$e->getMessage(),
'lizmapadmin'
);
$errors = array(
'title' => 'An error occurred while running the PostgreSQL query !',
'detail' => $e->getMessage(),
'title' => 'An error occurred while processing the request',
'detail' => 'Please contact the GIS administrator to look to the administrator logs.',
);

return $this->error($errors);
Expand Down
Loading